Aqueduct LogicModule Update Report - aqueductsandbox

×TopologySource: Kubernetes_Service_Topology (13)

{"name": "Kubernetes_Service_Topology", "appliesTo": "hasCategory(\"KubernetesService\")", "description": "Binds Kubernetes Services to their Pods using the K8 API for topology mapping.", "group": "Kubernetes", "searchKeywords": "kubernetes,service,topology", "collectionIntervalSec": 1800, "collectionMethod": "script", "collectionAttrs": "{\"scriptgroovy\":\"/*******************************************************************************\\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\\n ******************************************************************************/\\n\\nimport groovy.json.JsonSlurper\\nimport com.santaba.agent.groovyapi.http.HTTP\\n\\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\\nlmtopo = modLoader.load(\\\"lm.topo\\\", \\\"0\\\")\\n\\ndef keyNamespace = hostProps.get(hostProps.get(\\\"topo.namespace\\\", \\\"\\\"), \\\"\\\")\\ndef keyBlacklist = hostProps.get(\\\"topo.blacklist\\\", \\\"\\\").tokenize(\\\",\\\")\\ndef edges = []\\n\\ndef debug = false\\n\\ndef edge_label = \\\"Member\\\"\\n\\n// Collect K8 info and properties\\ndef k8s_info = getKubernetesProperties( hostProps, instanceProps )\\n\\n// Use preset K8 Service eri, alternatively use its resource path\\ndef service_eri = k8s_info.k8s_service_eri ? k8s_info.k8s_service_eri : k8s_info.k8s_selflink\\n\\n// Collect K8 Services\\ndef services = getKubernetesServices( k8s_info, k8s_info.k8s_namespace )\\nif (!services) { \\n println \\\"There was an issue fetching the relevant Kubernetes Services from the API.\\\"\\n return 1 \\n}\\n\\n// Parse for applied to K8 Servicwe\\ndef service = getKubernetesService(k8s_info, services.items.metadata.find() { it.name == k8s_info.k8s_name }.name.toString() )\\n\\n// Collect K8 Service's Pods\\ndef pods = getKubernetesPods( k8s_info, k8s_info.k8s_namespace )\\n\\n// Register edges between K8 Service resource path eri and each of its K8 tagged Pods resource path eris\\ndef selectors = service?.spec?.selector\\nif ( pods && selectors) {\\n pods.items.each { pod ->\\n def pod_labels = pod?.metadata?.labels\\n boolean allSelectorsFound = true\\n selectors.each { selector ->\\n if (pod_labels?.entrySet()?.contains(selector)) allSelectorsFound &= pod_labels.entrySet().contains(selector)\\n }\\n if (allSelectorsFound && pod.metadata.name) {\\n def podEri = \\\"/api/v1/namespaces/default/pods/${pod.metadata.name}\\\"\\n lmtopo.registerEdge(edge_label, service_eri, podEri, edges)\\n }\\n }\\n}\\n\\nprintln lmtopo.generateTopology(edges, keyNamespace, keyBlacklist, null, debug)\\n\\nreturn 0\\n\\n// Helper function for fetching K8 properties\\ndef getKubernetesProperties( parent_hostProps, parent_instanceProps ) {\\n def k8s_namespace = parent_hostProps?.get(\\\"auto.namespace\\\")\\n def k8s_name = parent_hostProps?.get(\\\"auto.name\\\")\\n def k8s_nodename = parent_hostProps?.get(\\\"auto.nodename\\\")\\n def k8s_selflink = parent_hostProps?.get(\\\"auto.selflink\\\")\\n def k8s_ssl = parent_hostProps?.get(\\\"auto.kubernetes.label.ssl\\\") ? parent_hostProps?.get(\\\"auto.kubernetes.label.ssl\\\") : true\\n\\n def k8s_service_eri = parent_hostProps?.get(\\\"predef.externalResourceID\\\")\\n\\n def env = System.getenv()\\n def k8s_service_host = env[\\\"KUBERNETES_SERVICE_HOST\\\"]\\n def k8s_service_port = env[\\\"KUBERNETES_SERVICE_PORT\\\"].toInteger()\\n\\n def k8s_service_ssl = (k8s_service_port == 443) ? true : false\\n if ( k8s_ssl ) { k8s_service_ssl = k8s_ssl }\\n\\n def k8s_serviceaccount_token = new File('/var/run/secrets/kubernetes.io/serviceaccount/token').text\\n def request_headers = [\\\"Authorization\\\" : \\\"Bearer ${k8s_serviceaccount_token}\\\"];\\n\\n return [\\n k8s_namespace: k8s_namespace,\\n k8s_name: k8s_name,\\n k8s_serviceaccount_token: k8s_serviceaccount_token,\\n k8s_selflink: k8s_selflink,\\n k8s_service_eri: k8s_service_eri,\\n k8s_service_host: k8s_service_host,\\n k8s_service_port: k8s_service_port,\\n k8s_service_ssl: k8s_service_ssl\\n ]\\n}\\n\\n// Helper method for fetching K8 Services\\ndef getKubernetesServices( k8s_info, String namespace_filter = null ) {\\n def json = null\\n if ( namespace_filter ) { json = queryAPI( \\\"/api/v1/namespaces/${namespace_filter}/services\\\", k8s_info ) }\\n else { json = queryAPI( \\\"/api/v1/services\\\", k8s_info ) }\\n\\n return json\\n}\\n\\n// Helper method for fetching K8 Services\\ndef getKubernetesService( k8s_info, name_override = null ) {\\n return queryAPI(\\\"/api/v1/namespaces/${k8s_info.k8s_namespace}/services/${ name_override ? name_override : k8s_info.k8s_name}\\\", k8s_info)\\n}\\n\\n\\n// Helper method for fetching K8 Service Pods\\ndef getKubernetesPods( k8s_info, String namespace_filter = null ) {\\n def json = null\\n if ( namespace_filter ) { json = queryAPI( \\\"/api/v1/namespaces/${namespace_filter}/pods\\\", k8s_info ) }\\n else { json = queryAPI( \\\"/api/v1/pods\\\", k8s_info ) }\\n\\n return json\\n}\\n\\n// Helper method for querying K8 API\\ndef queryAPI( String api_endpoint, k8s_info ) {\\n def http = HTTP.open(k8s_info.k8s_service_host, k8s_info.k8s_service_port, k8s_info.k8s_service_ssl )\\n def request_headers = [ \\\"Authorization\\\" : \\\"Bearer ${k8s_info.k8s_serviceaccount_token}\\\" ]\\n\\n http.get(api_endpoint, request_headers)\\n if ( http.statusCode == 200 ) { return new JsonSlurper().parseText(http.getResponseBody()) }\\n\\n http.close()\\n\\n return false\\n}\",\"linuxscript\":\"\",\"linuxcmdline\":\"\",\"scripttype\":\"embed\",\"windowscmdline\":\"\",\"windowsscript\":\"\",\"properties\":\"\"}"}

×TopologySource: Cisco_HSRP_L2_HA (38)

{"name": "Cisco_HSRP_L2_HA", "appliesTo": "isCisco()", "description": "Map Cisco HSRP enabled routers Active-Standby HA", "group": "High Availability", "searchKeywords": "hsrp,cisco,asa,network", "collectionIntervalSec": 3600, "collectionMethod": "script", "collectionAttrs": "{\"scriptgroovy\":\"/*******************************************************************************\\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\\n ******************************************************************************/\\n\\nimport com.santaba.agent.groovyapi.snmp.Snmp\\n\\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\\nlmtopo = modLoader.load(\\\"lm.topo\\\", \\\"0\\\")\\nlmtopoData = modLoader.load(\\\"lm.data.topo\\\", \\\"0\\\")\\nlmtopoData.run()\\n\\ndef host = hostProps.get(\\\"system.hostname\\\")\\ndef keyNamespace = hostProps.get(hostProps.get(\\\"topo.namespace\\\", \\\"\\\"), \\\"\\\")\\ndef keyBlacklist = hostProps.get(\\\"topo.blacklist\\\", \\\"\\\").tokenize(\\\",\\\")\\ndef edges = []\\n\\ndef debug = false\\n\\ndef props = hostProps.toProperties()\\n\\ndef hsrpState = Snmp.walkAsMap(host, \\\"1.3.6.1.4.1.9.9.106.1.2.1.1.15\\\", props).find { true }?.value // cHsrpGrpStandbyState - standby(5), active(6)\\nif (hsrpState) {\\n def cHsrpGrpActiveRouter = Snmp.walkAsMap(host, \\\"1.3.6.1.4.1.9.9.106.1.2.1.1.13\\\", props).find { true }?.value // cHsrpGrpActiveRouter \\n if (lmtopoData.blockedKeys.contains(cHsrpGrpActiveRouter)) {\\n if (debug) println \\\"Found bad active router address ${cHsrpGrpActiveRouter}\\\"\\n return 1\\n } \\n\\n def cHsrpGrpStandbyRouters = Snmp.walkAsMap(host, \\\"1.3.6.1.4.1.9.9.106.1.2.1.1.14\\\", props) // cHsrpGrpStandbyRouter\\n cHsrpGrpStandbyRouters.each { cHsrpGrpStandbyRouter ->\\n if (lmtopoData.blockedKeys.contains(cHsrpGrpStandbyRouter.value)) {\\n if (debug) println \\\"Found bad standby router address ${cHsrpGrpStandbyRouter.value}\\\"\\n return\\n }\\n \\n // If active, then map to standby\\n if (cHsrpGrpActiveRouter && cHsrpGrpStandbyRouter.value && hsrpState == \\\"6\\\") {\\n lmtopo.registerEdge(\\\"Active-Standby\\\", cHsrpGrpActiveRouter + \\\"--HSRP--active\\\", cHsrpGrpStandbyRouter.value + \\\"--HSRP--standby\\\", edges)\\n\\n // If standby, then map to active\\n } else if (cHsrpGrpActiveRouter && cHsrpGrpStandbyRouter.value && hsrpState == \\\"5\\\") {\\n lmtopo.registerEdge(\\\"Active-Standby\\\", cHsrpGrpStandbyRouter.value + \\\"--HSRP--standby\\\", cHsrpGrpActiveRouter + \\\"--HSRP--active\\\", edges) \\n }\\n }\\n}\\n\\nif (debug) {\\n println \\\"Primary/Standby: \\\" + hsrpState\\n}\\n\\nprintln lmtopo.generateTopology(edges, keyNamespace, keyBlacklist, null, debug)\\n\\nreturn 0\",\"linuxscript\":\"\",\"linuxcmdline\":\"\",\"scripttype\":\"embed\",\"windowscmdline\":\"\",\"windowsscript\":\"\",\"properties\":\"\"}"}

×TopologySource: Cisco_EIGRP (39)

{"name": "Cisco_EIGRP", "appliesTo": "isCisco()", "description": "Map Cisco EIGRP peers", "group": "Routing", "searchKeywords": "routing,eigrp,topology,layer 3,cisco", "collectionIntervalSec": 3600, "collectionMethod": "script", "collectionAttrs": "{\"scriptgroovy\":\"/*******************************************************************************\\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\\n ******************************************************************************/\\n\\nimport com.santaba.agent.groovyapi.snmp.Snmp\\n\\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\\nlmtopo = modLoader.load(\\\"lm.topo\\\", \\\"0\\\")\\nlmtopoData = modLoader.load(\\\"lm.data.topo\\\", \\\"0\\\")\\nlmtopoData.run()\\n\\ndef host = hostProps.get(\\\"system.hostname\\\")\\ndef keyNamespace = hostProps.get(hostProps.get(\\\"topo.namespace\\\", \\\"\\\"), \\\"\\\")\\ndef keyBlacklist = hostProps.get(\\\"topo.blacklist\\\", \\\"\\\").tokenize(\\\",\\\")\\ndef edges = []\\n\\ndef debug = false\\ndef mapinterfaces = hostProps.get(\\\"topo.mapinterfaces\\\") ?: false\\n\\ndef props = hostProps.toProperties()\\ndef timeout = 10000\\n\\ndef ips = hostProps.get(\\\"system.ips\\\")?.tokenize(\\\",\\\")\\ndef networkAddress = hostProps.get(\\\"auto.network.address\\\")\\nif (!(ips || networkAddress)) {\\n println \\\"Cannot determine applied to router's IP address\\\"\\n return 1\\n}\\n\\ndef eigrpRouterIp\\ndef eigrpRouterEri\\ndef converted_addrs = []\\n\\nMap peerAddrMap = Snmp.walkAsMap(host, \\\".1.3.6.1.4.1.9.9.449.1.4.1.1.3\\\", props, timeout);\\npeerAddrMap.each { k, val ->\\n\\n def converted_addr // will set once converted.\\n\\n // lets figure out what format our value is in.\\n if (val =~ /(\\\\d+)\\\\.(\\\\d+)\\\\.(\\\\d+)\\\\.(\\\\d+)/) {\\n // Ip Address\\n converted_addr = val\\n } else if (val =~ /[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}/) {\\n // HEX\\n // Convert val to base 10 if ip address is in hex format e.g. \\\"AC:14:00:32\\\"\\n converted_addr = hexToIP(val)\\n } else {\\n converted_hex = asciiToHex(val)\\n converted_ip = hexToIP(converted_hex)\\n converted_addr = converted_ip\\n }\\n\\n // Determine EIGRP router eri if we haven't yet\\n if (eigrpRouterEri == null) {\\n def eigrpRouterIp\\n if (ips) {\\n eigrpRouterIp = ips.find { converted_addr.contains(it?.tokenize(\\\".\\\")[0..1].join(\\\".\\\")) }\\n }\\n if (eigrpRouterIp == null && networkAddress) {\\n eigrpRouterIp = converted_addr.contains(networkAddress.tokenize(\\\".\\\")[0..1].join(\\\".\\\")) ? networkAddress : null\\n }\\n\\n if (eigrpRouterIp) {\\n eigrpRouterEri = \\\"eigrp--${eigrpRouterIp}\\\"\\n }\\n }\\n\\n if (lmtopo.isIP(converted_addr, lmtopoData.blockedKeys, debug)) converted_addrs << converted_addr\\n}\\n\\nconverted_addrs.each { ipAddr ->\\n def eigrpPeerEri = \\\"eigrp--${ipAddr}\\\"\\n if (!mapinterfaces) {\\n lmtopo.registerEdge(\\\"EIGRP Peer\\\", eigrpRouterEri, eigrpPeerEri, edges)\\n return\\n } \\n\\n lmtopo.registerEdge(\\\"Routing\\\", eigrpRouterEri, eigrpPeerEri, edges)\\n\\n def eigrpEndpointEri = \\\"endpoint:eigrp--${eigrpRouterIp}--${ipAddr}\\\"\\n lmtopo.registerEdge(\\\"Endpoint\\\", routerEri, eigrpEndpointEri, edges)\\n\\n def eigrpPeerEndpointEri = \\\"endpoint:ospf--${ipAddr}--${eigrpRouterIp}\\\"\\n lmtopo.registerEdge(\\\"EIGRP Peer\\\", eigrpEndpointEri, eigrpPeerEndpointEri, edges)\\n}\\n\\nprintln lmtopo.generateTopology(edges, keyNamespace, keyBlacklist, null, debug)\\n\\nreturn 0\\n\\n/**\\n * Converts HEX into an IP Address\\n */\\ndef hexToIP(input) {\\n\\n ArrayList base10IpAddress = []\\n\\n // Tokenize on \\\":\\\", convert to base 10, add to base10IpAddress\\n hexInts = input.tokenize(\\\":\\\")\\n hexInts.each { hexInt ->\\n base10IpAddress.add(Integer.parseInt(hexInt, 16))\\n }\\n\\n // Join on \\\".\\\" to form base 10 IP address val\\n output = base10IpAddress.join(\\\".\\\")\\n\\n return output\\n}\\n\\n/**\\n * Converts ASCII into HEX\\n */\\ndef asciiToHex(input) {\\n\\n ArrayList hex_array = []\\n\\n // Step-1 - Convert ASCII string to char array\\n char[] ch = input.toCharArray();\\n\\n for (char c : ch) {\\n int i = (int) c;\\n // Step-3 Convert integer value to hex using toHexString() method.\\n\\n hex_array << Integer.toHexString(i).toUpperCase()\\n }\\n\\n output = hex_array.join(\\\":\\\")\\n\\n return output\\n}\",\"linuxscript\":\"\",\"linuxcmdline\":\"\",\"scripttype\":\"embed\",\"windowscmdline\":\"\",\"windowsscript\":\"\",\"properties\":\"\"}"}

×TopologySource: Cisco_SDWAN_Topology (36)

{"name": "Cisco_SDWAN_Topology", "appliesTo": "hasCategory(\"Cisco_vManage\")", "description": "Generate Cisco SD-WAN topologies based on data from the vManage API.", "group": "SD-WAN", "searchKeywords": "vmanage,ucs,cisco,unified computing system,viptela", "collectionIntervalSec": 3600, "collectionMethod": "script", "collectionAttrs": "{\"scriptgroovy\":\"/*******************************************************************************\\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\\n ******************************************************************************/\\n\\n// To run in debug mode, set to true\\nBoolean debug = false\\n// To save collector logs, set to true\\nBoolean log = false\\n\\n// Collector version 30.000 or higher required for script cache and snippets\\ncollectorCache = null\\ndef modLoader\\ntry {\\n collectorCache = this.class.classLoader.loadClass(\\\"com.santaba.agent.util.script.ScriptCache\\\").getCache()\\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\\n}\\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\\n println \\\"Update collector to version 30.000 or higher for this DataSource.\\\"\\n return 1\\n}\\n\\ndef lmvMan = modLoader.load(\\\"cisco.vmanage\\\", \\\"0\\\") // Load Cisco vManage module\\ndef lmtopo = modLoader.load(\\\"lm.topo\\\", \\\"0\\\")\\n\\ndef keyNamespace = hostProps.get(hostProps.get(\\\"topo.namespace\\\", \\\"\\\"), \\\"\\\")\\ndef keyBlacklist = hostProps.get(\\\"topo.blacklist\\\", \\\"\\\").tokenize(\\\",\\\")\\ndef edges = []\\n\\n// Construct vManageSnippet class from snippet\\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\\n\\n// General debug info; prints property info when debug is set to true\\nsnip.generalDebug()\\n\\nif (snip.checkCachedCreds()) {\\n def devices = snip.getDevice()\\n if (devices) {\\n def vManageEri\\n def found = false\\n devices.'data'.each { it ->\\n if (found) return\\n def uuid = it.'uuid'?.toString()\\n def ip = it.'system-ip'?.toString()\\n def connectedVManages = it.'connectedVManages'?.toString()\\n if (uuid && ip && connectedVManages && connectedVManages.contains(ip)) {\\n vManageEri = uuid\\n found = true\\n }\\n }\\n\\n devices.'data'.each { it ->\\n def site = it.'site-id'\\n def uuid = it.'uuid'\\n if (site && uuid && uuid != vManageEri) {\\n def siteEri = \\\"cisco-sdwan--site--${vManageEri}--${site}\\\"\\n\\n lmtopo.registerEdge(\\\"Manage\\\", vManageEri, siteEri, edges)\\n // Redundant site edges unique()'d in generateTopology()\\n lmtopo.registerEdge(\\\"Manage\\\", siteEri, uuid, edges)\\n }\\n }\\n }\\n}\\nelse {\\n println \\\"Credential check failed. Try debug mode.\\\"\\n snip.LMDebugLog(\\\"Credential check failed.\\\")\\n\\treturn 1\\n}\\n\\nprintln lmtopo.generateTopology(edges, keyNamespace, keyBlacklist, null, debug)\\n\\nreturn 0\",\"linuxscript\":\"\",\"linuxcmdline\":\"\",\"scripttype\":\"embed\",\"windowscmdline\":\"\",\"windowsscript\":\"\",\"properties\":\"\"}"}

×TopologySource: Fortinet_FortiGate_SDWAN (31)

{"name": "Fortinet_FortiGate_SDWAN", "appliesTo": "hasCategory(\"Fortigate\")", "description": "Map Fortinet FortiGate SD WAN", "group": "SD-WAN", "searchKeywords": "ha,networking,paloalto", "collectionIntervalSec": 3600, "collectionMethod": "script", "collectionAttrs": "{\"scriptgroovy\":\"/*******************************************************************************\\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\\n ******************************************************************************/\\n\\nimport com.santaba.agent.groovyapi.snmp.Snmp\\n\\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\\nlmtopo = modLoader.load(\\\"lm.topo\\\", \\\"0\\\")\\nlmtopoData = modLoader.load(\\\"lm.data.topo\\\", \\\"0\\\")\\nlmtopoData.run()\\n\\ndef host = hostProps.get(\\\"system.hostname\\\")\\ndef ips = hostProps.get(\\\"system.ips\\\")?.tokenize(\\\",\\\")\\ndef props = hostProps.toProperties()\\ndef keyNamespace = hostProps.get(hostProps.get(\\\"topo.namespace\\\", \\\"\\\"), \\\"\\\")\\ndef keyBlacklist = hostProps.get(\\\"topo.blacklist\\\", \\\"\\\").tokenize(\\\",\\\")\\ndef edges = []\\n\\ndef debug = false\\n\\ndef timeout = 10000\\n\\ndef vdomNames = Snmp.walkAsMap(host, \\\".1.3.6.1.4.1.12356.101.3.2.1.1.2\\\", props, timeout)\\n\\ndef vpnTunnelVDOM = Snmp.walkAsMap(host, \\\".1.3.6.1.4.1.12356.101.12.2.2.1.21\\\", props, timeout)\\ndef vpnTunnelEntries = Snmp.walkAsMap(host, \\\".1.3.6.1.4.1.12356.101.12.2.2.1\\\", props, timeout)\\n\\ndef fortigateDeviceEri\\nvpnTunnelVDOM.each { index, vdomID ->\\n\\n def remoteGatewayIP = vpnTunnelEntries[\\\"4.${index}\\\"]\\n def remoteGatewayPort = vpnTunnelEntries[\\\"5.${index}\\\"]\\n def localGatewayIP = vpnTunnelEntries[\\\"6.${index}\\\"]\\n def localGatewayPort = vpnTunnelEntries[\\\"7.${index}\\\"]\\n\\n if (ips.contains(localGatewayIP) && lmtopo.isIP(localGatewayIP, lmtopoData.blockedKeys, debug)) {\\n fortigateDeviceEri = \\\"fortigate--${localGatewayIP}\\\"\\n }\\n\\n if (fortigateDeviceEri && lmtopo.isIP(remoteGatewayIP, lmtopoData.blockedKeys, debug)) {\\n lmtopo.registerEdge(\\\"FortiGate Tunnel\\\", fortigateDeviceEri, \\\"fortigate--${remoteGatewayIP}\\\", edges)\\n }\\n}\\n\\nprintln lmtopo.generateTopology(edges, keyNamespace, keyBlacklist, null, debug)\\n\\nreturn 0\",\"linuxscript\":\"\",\"linuxcmdline\":\"\",\"scripttype\":\"embed\",\"windowscmdline\":\"\",\"windowsscript\":\"\",\"properties\":\"\"}"}

×PropertySource: addCategory_NetApp (139)

{"name": "addCategory_NetApp", "appliesTo": "netapp.user && netapp.pass", "description": "Identifies the NetApp host, discovers if SSL is being used, what mode its running in (7 mode or Cluster mode), and assigns a system category of either 'NetApp_7Mode' or 'NetApp_ClusterMode'.", "group": "NetApp", "searchKeywords": "cluster mode,storage,7 mode,netapp", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport netapp.manage.NaElement\nimport netapp.manage.NaException\nimport netapp.manage.NaServer\n\nhostname = hostProps.get(\"system.hostname\")\nusername = hostProps.get(\"netapp.user\")\npassword = hostProps.get(\"netapp.pass\")\n\n\n// create a global XML slurper\nslurper = new XmlSlurper()\n\noutput = getONTAPIVersion()\n\nssl = output['ssl']\nontapi_version = output['ontapi_version']\n\nprintln \"auto.ontapi.ssl=\" + ssl\nprintln \"auto.system.ontapi_version=\" + ontapi_version\n\n// TRUE = Cluster Mode / CDOT , FALSE = 7 Mode\nnetapp_clustered_mode = slurper.parseText(getQueryResults('system-get-version')).'is-clustered'\n\n// which version are we working with ?\nif (netapp_clustered_mode == true) {\n // Cluster Mode / CDOT\n println \"auto.system.mode=Cluster_Mode\"\n println \"system.categories=NetApp_ClusterMode,NetApp\"\n}\nelse if (netapp_clustered_mode == false) {\n // 7 Mode\n println \"auto.system.mode=7_Mode\"\n println \"system.categories=NetApp_7Mode,NetApp\"\n}\nelse if (hostProps.get(\"system.sysinfo\") =~ \"NetApp\") {\n println \"system.categories=NetApp\"\n\n}\n\nreturn 0\n\n\n/**\n * Helper method to execute queries.\n * @param query\n * @return returns pretty output to later be slurpered by xmlSlurper.\n */\ndef getQueryResults(String query) {\n // Create new connection to NetApp device.\n NaServer s = new NaServer(hostname, 1, ontapi_version.toString().split(/\\./)[1].toInteger())\n s.setServerType(NaServer.SERVER_TYPE_FILER)\n\n if (ssl == true) {\n s.setTransportType(NaServer.TRANSPORT_TYPE_HTTPS)\n s.setPort(443)\n }\n else {\n s.setTransportType(NaServer.TRANSPORT_TYPE_HTTP)\n s.setPort(80)\n }\n\n s.setStyle(NaServer.STYLE_LOGIN_PASSWORD)\n s.setAdminUser(username, password)\n\n NaElement api = new NaElement(query)\n NaElement xo = s.invokeElem(api)\n\n return (xo.toPrettyString(\"\"))\n}\n\n/**\n * Helper method to check ssl config if host is listening on port 80(HTTP) or 443(HTTPS).\n * @return boolean\n */\ndef getONTAPIVersion() {\n // List of ports to check.\n // 80 = HTTP\n // 443 = HTTPS\n ArrayList port_check_list = [443, 80]\n\n ArrayList api_listening_ports = []\n def ontapi_version = 14 // start with version 14 and will adjust once version is identified.\n\n // iterate through ports.\n port_check_list.each{ port ->\n // If user did not setup for 443, this first attempt is expected to fail\n try {\n // Create new connection to NetApp device.\n NaServer s = new NaServer(hostname, 1, ontapi_version)\n s.setServerType(NaServer.SERVER_TYPE_FILER)\n\n // Which port are we using ?\n if (port == 80) {\n // Port 80\n s.setTransportType(NaServer.TRANSPORT_TYPE_HTTP)\n }\n else {\n // Port 443\n s.setTransportType(NaServer.TRANSPORT_TYPE_HTTPS)\n }\n\n s.setPort(port)\n s.setStyle(NaServer.STYLE_LOGIN_PASSWORD)\n s.setAdminUser(username, password)\n\n // Set API endpoint\n NaElement api = new NaElement(\"system-get-ontapi-version\")\n\n // Query the API.\n NaElement xo = s.invokeElem(api)\n\n if (xo.toString().contains(\"passed\")) {\n api_listening_ports.push(port)\n\n slurper.parseText(xo.toPrettyString(\"\")).each{ it ->\n ontapi_version = \"${it.'major-version'}.${it.'minor-version'}\"\n }\n }\n }\n catch (Exception e) {\n // Exceptions will occur if the first port we try isn't the right one to use\n // Simply catch and move on to the next one\n }\n }\n\n // Return appropriate value for SSL depending on which listening ports we discovered\n if (api_listening_ports.contains(443)) {\n return ['ssl': true, 'ontapi_version': ontapi_version]\n }\n else if (api_listening_ports.contains(80)) {\n return ['ssl': false, 'ontapi_version': ontapi_version]\n }\n}"}, "propertySourceType": 0}

×PropertySource: addCategory_Linux_SSH (57)

{"name": "addCategory_Linux_SSH", "appliesTo": "/* Applies to hosts which are not AWS or Azure and either have no categories set or only the following; collector, OracleDB.*/\n(join(system.categories, \",\") == \"\" || \njoin(system.categories, \"\") =~ \"^(collector|OracleDB){1,2}$\") \n&& system.devicetype == \"0\" \n&& (ssh.user && (ssh.pass || ssh.cert)) \n&& !hasCategory(\"Linux_SSH\")", "description": "Applies to hosts (excluding AWS and Azure) which have not been properly identified due to unconfigured SNMP, attempting to connect via SSH.\n\nAuthentication Requirements:\n1. Certification\n - 'ssh.user' \n - 'ssh.cert'\n \n2. User & Password\n - 'ssh.user' \n - 'ssh.pass'", "group": "Linux", "searchKeywords": "linux,ssh", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.jcraft.jsch.JSch\nimport com.santaba.agent.util.Settings\n\nhost = hostProps.get(\"system.hostname\")\nuser = hostProps.get(\"ssh.user\")\npass = hostProps.get(\"ssh.pass\")\nport = hostProps.get(\"ssh.port\")?.toInteger() ?: 22\ncert = hostProps.get(\"ssh.cert\") ?: '~/.ssh/id_rsa'\n\ntimeout = 15000 // timeout in milliseconds\n\nif(!probeTcpPort(host, port)) {\n println \"Configured ssh port (${port}) is closed, exiting\"\n return 1\n}\n\n// command to output all information about the Linux host.\ndef linux_version_cmd = \"uname -a;\"\n\ndef command_output = getCommandOutput(linux_version_cmd)\n\nif (command_output?.toLowerCase() =~ 'linux') {\n println \"system.categories=Linux_SSH\"\n}\n\nreturn 0\n\n\n/**\n * Helper method which handles creating JSCH session and executing commands\n * @return\n */\ndef getCommandOutput(String input_command) {\n try {\n // instantiate JSCH object.\n jsch = new JSch()\n\n // do we have an user and no pass ?\n if (user && !pass) {\n // Yes, so lets try connecting via cert.\n jsch.addIdentity(cert)\n }\n\n session = jsch.getSession(user, host, port.toInteger())\n\n // given we are running non-interactively, we will automatically accept new host keys.\n session.setConfig(\"StrictHostKeyChecking\", \"no\")\n String authMethod = Settings.getSetting(Settings.SSH_PREFEREDAUTHENTICATION, Settings.DEFAULT_SSH_PREFEREDAUTHENTICATION)\n session.setConfig(\"PreferredAuthentications\", authMethod)\n\n // set session timeout, in milliseconds.\n session.setTimeout(timeout)\n\n // is host configured with a user & password?\n if (pass) {\n // set password.\n session.setPassword(pass)\n }\n\n session.connect()\n channel = session.openChannel(\"exec\")\n channel.setCommand(input_command)\n\n def commandOutput = channel.getInputStream()\n channel.connect()\n\n def output = commandOutput.text;\n\n channel.disconnect()\n\n return output\n }\n // ensure we disconnect the session.\n finally {\n session.disconnect()\n }\n}\n\n\nstatic boolean probeTcpPort(String host, int port) {\n Socket socket = null\n try {\n socket = new Socket()\n socket.connect(new InetSocketAddress(host, port.toInteger()), 3000)\n return true\n } catch (IOException ignored) {\n } finally {\n socket.close()\n }\n return false\n}"}, "propertySourceType": 0}

×PropertySource: Sentry4_Product_Info (243)

{"name": "Sentry4_Product_Info", "appliesTo": "hasCategory(\"Sentry4\")", "description": "Collects various system level information on ServerTech Sentry 4 units, such as product name, location, firmware, serial number, etc.", "group": "Sentry4", "searchKeywords": "servertech,pdu,power distribution unit,sentry4", "script": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname');\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n// Throw into a try/catch\ntry\n{\n /*\n The following SNMP walkAsMap will handle v1 , v2 and v3.\n Props contains a map of ALL host properties and the SNMP walk method will automatically\n handle the proper connection based on which SNMP version is configured.\n */\n \n //a map for the possible product series \n Map productSeriesMap = \n [\n '0':'pro1',\n '1':'pro2'\n ]\n \n // define maps we will walk.\n def sysinfoMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1718.4.1.1.1\", props, timeout);\n\n println \"auto.sentry4.system.name=\" + sysinfoMap['1.0']\n println \"auto.sentry4.system.location=\" + sysinfoMap['2.0']\n println \"auto.sentry4.system.firmware_version=\" + sysinfoMap['3.0']\n println \"auto.sentry4.system.build_info=\" + sysinfoMap['4.0']\n println \"auto.sentry4.system.serial_number=\" + sysinfoMap['5.0']\n println \"auto.sentry4.system.hardware_info=\" + sysinfoMap['6.0']\n println \"auto.sentry4.system.product_series=\" + productSeriesMap[sysinfoMap['7.0']]\n println \"auto.sentry4.system.config_modified_count=\" + sysinfoMap['20.0']\n println \"auto.sentry4.system.unit_count=\" + sysinfoMap['21.0']\n\n\n // execution was successful, return 0;\n return 0;\n}\n\ncatch (Exception e)\n{\n // if exception is caught, print it out and return 1;\n println e;\n return 1;\n}"}, "propertySourceType": 0}

×PropertySource: addCategory_VMwareHorizonConnectionServer (103)

{"name": "addCategory_VMwareHorizonConnectionServer", "appliesTo": "(isWindows() && ((horizon.user && horizon.pass) || !auto.vmware.horizon.psrun)) && !hasCategory(\"VMwareHorizonConnectionServer\")", "description": "Applies the category VMwareHorizonConnectionServer to machines identified as running VMware Horizon Connection Server via WMI.", "group": "VMware Horizon", "searchKeywords": "horizon,vmware,powershell,api", "script": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n#------------------------------------------------------------------------------------------------------------\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$wmi_user = @'\n##WMI.USER##\n'@\n$hostname = '##SYSTEM.HOSTNAME##'\n$collectorName = hostname\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\") {\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName\n}\n\n$scriptblock = {\n $Uninstall_HKLM_Output = Get-ItemProperty \"HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*\" | Select-Object DisplayName, DisplayVersion\n # $Uninstall_HKLM_Output\n foreach ($Uninstall_HKLM_Output in $Uninstall_HKLM_Output)\n {\n # If we find a matching DisplayName then get the DisplayName\n if ($Uninstall_HKLM_Output.DisplayName -And ($Uninstall_HKLM_Output.DisplayName -Like \"*Horizon*\") -And ($Uninstall_HKLM_Output.DisplayName -notLike \"*Agent*\"))\n {\n Write-Host \"system.categories=VMwareHorizonConnectionServer\"\n }\n }\n\n}\n$Opt = New-CimSessionOption -Protocol Dcom\n$SessionParams = @{\n ErrorAction = 'Stop'\n SessionOption = $Opt\n}\n$InvokeParams = @{\n ErrorAction = 'Stop'\n Scriptblock = $scriptblock\n}\n\n#-----Determine the type of query to make-----\nif ($hostname -match $collectorName)\n{\n # are wmi user/pass set -- e.g. are these device props either not substiuted or blank\n}\nelseif (([string]::IsNullOrWhiteSpace($wmi_user) -and [string]::IsNullOrWhiteSpace($wmi_pass)) -or (($wmi_user -like '*WMI.USER*') -and ($wmi_pass -like '*WMI.PASS*')))\n{\n $SessionParams.ComputerName = $hostname\n $InvokeParams.ComputerName = $hostname\n}\nelse\n{\n # yes. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $wmi_pass -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $wmi_user, $remote_pass;\n $SessionParams.ComputerName = $hostname\n $SessionParams.Credential = $remote_credential\n $InvokeParams.ComputerName = $hostname\n $InvokeParams.Credential = $remote_credential\n}\n\n# Fallback method if above fails\nif ($hostname -match $collectorName)\n{\n Invoke-Command @InvokeParams\n}\nelseIf ( Test-wsman -ComputerName $hostname -ErrorAction SilentlyContinue)\n{\n Invoke-Command @InvokeParams\n}\nelse\n{\n $Session = New-CimSession @SessionParams\n\n $horizon = Get-CimInstance -CimSession $Session -ClassName Win32_Product | where { $_.name -like '*horizon*connection*' }\n if ($horizon){\n Write-Host \"system.categories=VMwareHorizonConnectionServer\"\n }\n}\n\n# Property to indicate the propertysource was run so we don't\n# keep trying on windows servers without credentials\nWrite-Host \"auto.vmware.horizon.psrun=true\"\n\nexit 0"}, "propertySourceType": 0}

×PropertySource: Viptela_Product_Info (242)

{"name": "Viptela_Product_Info", "appliesTo": "hasCategory(\"Viptela_vEdge\") || hasCategory(\"Viptela_vSmart\") || hasCategory(\"Viptela_vManage\") || hasCategory(\"Viptela_vBond\")", "description": "Gathers various bits of metadata from the Viptela host.", "group": "Viptela", "searchKeywords": "sdwan,vsmart,vmanage,vbond,vedge,viptela", "script": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname');\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n// Throw into a try/catch\ntry\n{\n /*\n The following SNMP walkAsMap will handle v1 , v2 and v3.\n Props contains a map of ALL host properties and the SNMP walk method will automatically\n handle the proper connection based on which SNMP version is configured.\n */\n\n // define maps we will walk.\n def systemInfoMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.11.1\", props, timeout);\n\n Map models_map =\n [\n '1':'vSmart',\n '2':'vManage',\n '3':'vBond',\n '4':'vEdge-1000',\n '5':'vEdge-2000',\n '6':'vEdge-100',\n '7':'vEdge-100-W2',\n '8':'vEdge-100-WM',\n '9':'vEdge-100-M2',\n '10':'vEdge-100-M',\n '11':'vEdge-100-B',\n '12':'vEdge-Cloud',\n '13':'vContainer',\n '100':'vEdge-SIM',\n ]\n\n println \"auto.viptela.system.version=\" + systemInfoMap['2.0']\n println \"auto.viptela.system.filesystem=\" + systemInfoMap['22.0']\n println \"auto.viptela.system.config_template=\" + systemInfoMap['38.0']\n println \"auto.viptela.system.model=\" + models_map[systemInfoMap['47.0']]\n println \"auto.viptela.system.bootloader_version=\" + systemInfoMap['52.0'].trim()\n println \"auto.viptela.system.build_number=\" + systemInfoMap['53.0'].trim()\n println \"auto.viptela.system.model_sku=\" + systemInfoMap['56.0']\n\n // execution was successful, return 0;\n return 0;\n}\n\ncatch (Exception e)\n{\n // if exception is caught, print it out and return 1;\n println e;\n return 1;\n}"}, "propertySourceType": 0}

×PropertySource: addCategory_Veeam_BackupAndReplication_PowerShell (130)

{"name": "addCategory_Veeam_BackupAndReplication_PowerShell", "appliesTo": "isWindows()", "description": "Determines if the device exposes the Veeam Backup and Recovery PowerShell cmdlet. \n\nRequirements:\n- PowerShell remoting must also be enabled from the collector to the target device.\n- Collector user must have permissions or credentials must be provided as properties.\n-- Veeam (veeam.user and veeam.pass)\n-- WMI (wmi.user and wmi.pass)\n-- The username cannot contain \"veeam.user\" or \"wmi.user\"\n\nPrecedence is given to the Veeam properties if both are defined.", "group": "Veeam", "searchKeywords": "replication,backup,storage,veeam", "script": {"type": "powershell", "content": "<# \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved. #>\n\n$hostname = '##system.hostname##'\n$categories = '##system.categories##'\n\n# If the hostname is an IP address query DNS for the FQDN\nif($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\"){\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName\n}\n\n$veeam_user = @'\n##veeam.user##\n'@\n$veeam_pass = @'\n##veeam.pass##\n'@\n$wmi_user = @'\n##wmi.user##\n'@\n$wmi_pass = @'\n##wmi.pass##\n'@\n\n#Check if we have valid veeam credentials, if we need to use wmi, or if we have nothing\n[bool]$UseCredentials = $true\nif([string]::IsNullOrEmpty($veeam_user) -OR $veeam_user -like \"*veeam.user*\"){\n if(-NOT([string]::IsNullOrEmpty($wmi_user) -OR $wmi_user -like \"*wmi.user*\")){\n $veeam_user = $wmi_user\n }else{\n $UseCredentials = $false\n }\n}\nif($UseCredentials -AND ([string]::IsNullOrEmpty($veeam_pass) -OR $veeam_pass -like \"*veeam.pass*\")){\n if(!([string]::IsNullOrEmpty($wmi_pass) -OR $wmi_pass -like \"*wmi.pass*\")){\n $veeam_pass = $wmi_pass\n }else{\n $UseCredentials = $false\n }\n}\n\n\n\nfunction Get-VeeamConnection {\n Param (\n # Hostname of the Veeam Server we are connecting to.\n [Parameter(Mandatory = $true)]\n [string]\n $VeeamHostname,\n\n # Veeam Username\n [Parameter(Mandatory = $false)]\n [string]\n $VeeamUsername,\n\n # Veeam Password\n [Parameter(Mandatory = $false)]\n [String]\n $VeeamPassword\n )\n\n $max_attempts = 2\n $attempt_sleep = 2\n $current_attempt_count = 0\n\n\tif($VeeamUsername -and $VeeamPassword){\n $secure_pass = ConvertTo-SecureString -String $VeeamPassword -AsPlainText -Force\n $creds = New-Object -typename System.Management.Automation.PSCredential($VeeamUsername, $secure_pass)\n}\n ## Attempt to acquire a persistent session object. Keep trying until we hit the $max_attempts value.\n while (-Not$veeam_session -and ($current_attempt_count -le $max_attempts)) {\n\n $current_attempt_count++\n if($VeeamUsername -and $VeeamPassword){\n $veeam_session = New-PSSession -ComputerName $VeeamHostname -Credential $creds\n } else{\n $veeam_session = New-PSSession -ComputerName $VeeamHostname\n }\n Start-Sleep -Seconds $attempt_sleep\n #} #Removed the if/else. This is the terminating } for else\n }\n\n ## Ensure that the session was successfully created, otherwise exit.\n if ( -Not $veeam_session ) {\n Write-Host \"Error connecting session. Terminating.\"\n Exit\n }\n\n Invoke-Command -Session $veeam_session -ScriptBlock {\n ## Version 11 removed the snapin. The following gains version info from the dll instead. Known to work for v10 and v11.\n function Get-DLLVersion {\n $corePath = Get-ItemProperty -Path \"HKLM:\\Software\\Veeam\\Veeam Backup and Replication\\\" -Name \"CorePath\"\n $depDLLPath = Join-Path -Path $corePath.CorePath -ChildPath \"Packages\\VeeamDeploymentDll.dll\" -Resolve\n $file = Get-Item -Path $depDLLPath\n $version = $file.VersionInfo.ProductVersion\n return $version\n }\n Add-PSSnapin -Name VeeamPSSnapIn -WarningAction SilentlyContinue -ErrorAction SilentlyContinue\n }\n return $veeam_session\n}\n\n## Script Run Starts Here\n\n# is it a collector?\nif(-not($categories.toLower().Contains('collector'))){\n # not a collector, check for credentials\n if ($UseCredentials) {\n # try to use provided credentials\n $session1 = Get-VeeamConnection -VeeamHostname $hostname -VeeamUsername $veeam_user -VeeamPassword $veeam_pass\n } else {\n # we don't have credentials, let's try to use the collector credentials\n $session1 = Get-VeeamConnection -VeeamHostname $hostname\n }\n ## Check to see if the host is a Veeam Server. If so, let's add the category.\n $veeam_server = Invoke-Command -Session $session1 -ScriptBlock {\n $VeeamHost = Get-VBRLocalhost -WarningAction SilentlyContinue -ErrorAction SilentlyContinue\n Write-Host \"auto.veeam.snapin-version=\"(Get-PSSnapin VeeamPSSnapin).Version\n $version = Get-DLLVersion\n Write-Host \"auto.veeam.version=$version\"\n\n if ($VeeamHost) {\n return $VeeamHost\n }\n else {\n return $null\n }\n }\n\n if ( $veeam_server -and $veeam_server.IsUnavailable -eq $false ) {\n Write-Host \"system.categories=VeeamBackupAndReplicationPowerShell\"\n }\n}else{\n Add-PSSnapin -Name VeeamPSSnapIn -WarningAction SilentlyContinue -ErrorAction SilentlyContinue\n\n $VeeamHost = Get-VBRLocalhost -WarningAction SilentlyContinue -ErrorAction SilentlyContinue\n Write-Host \"auto.veeam.snapin-version=\"(Get-PSSnapin VeeamPSSnapin).Version\n $version = Get-DLLVersion\n Write-Host \"auto.veeam.version=$version\"\n\n if ($VeeamHost -and $VeeamHost.IsUnavailable -eq $false ) {\n Write-Host \"system.categories=VeeamBackupAndReplicationPowerShell\"\n } else {\n return $null\n }\n}\n\n## Remove our PSSession if we had one\nif( $session1 ) {\n Remove-PSSession $session1\n}\nExit"}, "propertySourceType": 0}

×PropertySource: addCategory_Ubiquiti_UniFi (102)

{"name": "addCategory_Ubiquiti_UniFi", "appliesTo": "(unifi.user && unifi.pass) && !hasCategory(\"Ubiquiti_Unifi\")", "description": "Discovers if a host is a Ubiquiti UniFi Controller and sets the appropriate system category.\n\nRequired properties:\n- 'unifi.user'\n- 'unifi.pass'", "group": "Ubiquiti", "searchKeywords": "controller,wifi,ubiquiti,unifi,network", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport org.apache.http.HttpEntity\nimport org.apache.http.client.entity.EntityBuilder\nimport org.apache.http.client.methods.CloseableHttpResponse\nimport org.apache.http.client.methods.HttpPost\nimport org.apache.http.client.methods.HttpUriRequest\nimport org.apache.http.conn.ssl.NoopHostnameVerifier\nimport org.apache.http.conn.ssl.TrustSelfSignedStrategy\nimport org.apache.http.impl.client.BasicCookieStore\nimport org.apache.http.impl.client.CloseableHttpClient\nimport org.apache.http.impl.client.HttpClients\nimport org.apache.http.ssl.SSLContextBuilder\n\nimport javax.net.ssl.SSLContext\nimport java.security.cert.CertificateException\nimport java.security.cert.X509Certificate\n\n// To run in debug mode, set to true\ndef debug = false\n\ndef username = hostProps.get(\"unifi.user\")\ndef password = hostProps.get('unifi.pass')\ndef hostname = hostProps.get(\"system.hostname\")\ndef httpPort = 8443\n\n// Define login endpoint\ndef loginUrl = \"https://$hostname/api/auth/login\"\n\n// Try to login\nString response = queryMethod(loginUrl, username, password, debug)\n////Check if new API authentication endpoint response, if not authenticate with old endpoint.\nif (response && !response?.contains('\"msg\":\"api.err.LoginRequired\"')) {\n responseJson = new JsonSlurper().parseText(response)\n if(responseJson.status.toString().toLowerCase() == 'active'){\n println \"system.categories=Ubiquiti_Unifi\"\n }\n}\nelse {\n loginUrl = \"https://$hostname:$httpPort/api/login\"\n response = queryMethod(loginUrl, username, password, debug)\n responseJson = new JsonSlurper().parseText(response)\n if(responseJson.meta.rc.toString().toLowerCase() == 'ok'){\n println \"system.categories=Ubiquiti_Unifi\"\n }\n}\n\nreturn 0\n\n// Split query process into a method for easier readability and usage.\ndef queryMethod(String loginUrl, String username, String password, Boolean debug)\n{\n\n //Create a cookie store to support cookies\n BasicCookieStore cookieStore = new BasicCookieStore()\n\n //Create an SSL policy that ignores the certificate\n SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()\n {\n public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException\n {\n return true\n }\n }).build()\n\n // Create an HTTP client\n CloseableHttpClient httpclient = HttpClients.custom()\n .setDefaultCookieStore(cookieStore)\n .setSSLContext(sslContext)\n .setSSLHostnameVerifier(new NoopHostnameVerifier())\n .build()\n\n //Create the body to be posted during login\n HttpEntity entity = EntityBuilder.create()\n .setText(/{\"username\":\"$username\",\"password\":\"$password\"}/)\n .build()\n\n // Create our request\n HttpPost login = new HttpPost(loginUrl)\n login.setEntity(entity)\n login.setHeader(\"Content-type\", \"application/json\")\n login.setHeader(\"Accept\", \"application/json\")\n\n // Closure to make our calls\n Closure httpCall = { HttpUriRequest request, Closure processOutput ->\n CloseableHttpResponse response\n try\n {\n response = httpclient.execute(request)\n processOutput(response)\n }\n finally\n {\n if (response)\n {\n response.close()\n }\n }\n }\n\n try\n {\n httpCall(login) {\n response ->\n return response.getEntity().getContent().getText()\n }\n }\n catch (Exception e)\n {\n LMDebugPrint(\"HTTP script failed login: ${e.message}\", debug)\n }\n finally\n {\n httpclient.close()\n }\n}\n\n/**\n * Helper function to print out debug messages for troubleshooting purposes.\n */\ndef LMDebugPrint(message, Boolean debug) {\n if (debug) {\n println(message.toString())\n }\n}"}, "propertySourceType": 0}

×PropertySource: Raritan_PowerDistribution_Info (239)

{"name": "Raritan_PowerDistribution_Info", "appliesTo": "hasCategory(\"RaritanPdu2\")", "description": "Collects metadata on Raritan power distribution devices which respond to the PDU2-MIB (Gen2 devices).\n\nhttps://www.raritan.com/products/power/power-distribution\n\n\nCollect info on Raritan gen2 devices that respond to the PDU2-MIB.", "group": "Raritan", "searchKeywords": "pdu,power distribution unit,raritan,hardware", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp;\n\ndef host = hostProps.get(\"system.hostname\")\ndef props = hostProps.toProperties()\ndef timeout = 100000\n\nnameInfo = Snmp.walkAsMap(host, \".1.3.6.1.4.1.13742.6.3.2.1.1\", props, timeout)\nunitInfo = Snmp.walkAsMap(host, \".1.3.6.1.4.1.13742.6.3.2.2.1\", props, timeout)\n\nnameLegend = ['2' : 'manufacturer',\n '3' : 'model',\n '4' : 'serialnumber',\n '5' : 'ratedvoltage',\n '6' : 'ratedcurrent',\n '7' : 'ratedfrequency',\n '8' : 'ratedvoltamps',\n '51': 'macaddress']\n\nunitLegend = ['2' : 'inletcount',\n '3' : 'overcurrentprotectorcount',\n '4' : 'outletcount',\n '5' : 'inletcontrollercount',\n '6' : 'outletcontrollercount',\n '7' : 'externalsensorcount',\n '13': 'pduname',]\n\nlmPrint(nameInfo, nameLegend)\nlmPrint(unitInfo, unitLegend)\n\nreturn 0\n\ndef lmPrint(HashMap propMap, HashMap legendMap) {\n propMap.each {\n oidIndex, value ->\n counterIndex = oidIndex.tokenize('.')[0]\n if (legendMap.containsKey(counterIndex)) {\n println \"auto.raritan.pdu.${legendMap[counterIndex]}=${value}\"\n }\n }\n}"}, "propertySourceType": 0}

×PropertySource: addCategory_mGuard (175)

{"name": "addCategory_mGuard", "appliesTo": "(system.sysinfo =~ \"mGuard\" ||\nsystem.sysinfo =~ \"mguard\" || \nsystem.sysoid =~ \"1\\\\.3\\\\.6\\\\.1\\\\.4\\\\.1\\\\.4346\\\\.11\\\\.1\\\\.2\\\\.1\\\\.1\\\\.1\\\\.235\") && !hasCategory(\"mGuard\")", "description": "Identifies if the host replies to the mGuard mib and sets a system category of \"mGuard\".\n\nAs there are multiple manufacturers of mGuard devices, it it not guaranteed that they will all have same/similar system OID's.", "group": "mGuard", "searchKeywords": "security,vpn,mguard,networking", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp;\n\n// Set environment variables.\ndef hostname = hostProps.get('system.hostname');\ndef props = hostProps.toProperties()\ndef snmp_timeout = 10000\n\n// Set SNMP OID.\ndef snmp_oid = '.1.3.6.1.4.1.15450.2.4.5.1.0';\n\n// execute our SNMP GET and store the value.\noutput = Snmp.get(hostname, snmp_oid, props, snmp_timeout);\n\nif (output) {\n\n // receiving a valid output for this OID means the host successfully responded and is a mGuard device.\n println \"system.categories=mGuard\"\n}\n\n// Successful script execution, return 0;\nreturn 0;"}, "propertySourceType": 0}

×PropertySource: addERI_Cisco (1)

{"name": "addERI_Cisco", "appliesTo": "isCisco()", "description": "Sets device External Resource IDs (ERIs) for layer 2 topology mapping of Cisco devices, including CDP global device ID using CISCO-CDP-MIB, LLDP local system name using LLDP-MIB, and MAC addresses using RFC1213-MIB. \n\nSets ERI Type (ERT) by parsing the device's properties for defined keywords, defaults to \"Unknown\" if not determined. \n\nSets auto.eri.override in order to prevent addERI_* PropertySource collisions.\nRequires collector version 30.000 or greater.", "group": "ERI", "searchKeywords": "topology,layer 2,cisco", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport org.json.JSONArray\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\nlmtopo = modLoader.load(\"lm.topo\")\nlmtopoSnmp = modLoader.load(\"lm.topo.snmp\", \"0\")\nlmtopoData = modLoader.load(\"lm.data.topo\", \"0\")\nlmtopoData.run()\n\ndef host = hostProps.get(\"system.hostname\")\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\ndef debug = false\n\ndef timeout = 300000\n\ndef ert = lmtopo.propsToErt(hostProps, lmtopoData.ciscoPropsToParse, lmtopoData.ciscoKeywordsMap, debug)\n\ndef l2Eri = []\ndef hsrpEri = []\n\ndef cdpDeviceId = lmtopoSnmp.getCdpDeviceId(host, debug)\nlmtopo.processCDPDeviceId(cdpDeviceId, lmtopoData.blockedKeys, l2Eri, debug)\n\n// Check if we have a Cisco Stack switch before setting LLDP chassis ID ERI\ndef ciscoDescription = hostProps.get(\"auto.cisco.description\")\nif (ciscoDescription && !ciscoDescription.toLowerCase().contains(\"stack\")) {\n def lldpLocalChassisId = lmtopoSnmp.getLldpLocalChassisId(host, debug)\n lmtopo.processLLDPLocalChassisId(lldpLocalChassisId, lmtopoData.blockedKeys, l2Eri, debug) \n}\n\n// Check if we have a Cisco Controller before setting MAC ERI\ndef sysinfo = hostProps.get(\"system.sysinfo\")\nif (!sysinfo.contains(\"Cisco Controller\")) { \n if (sysinfo.contains(\"Cisco Firepower Threat Defense\")) lmtopoData.blockedInterfaceTypes.remove(\"53\") // Allow proprietary interface type for FTD\n def ifTable = lmtopoSnmp.extractInterfaces(host, null, timeout, debug)\n lmtopo.processIntefaceTable(ifTable, lmtopoData.blockedInterfaceNames, lmtopoData.blockedInterfaceTypes, lmtopoData.blockedKeys, l2Eri, debug)\n} else {\n ert = \"Router\"\n}\n\ndef categories = hostProps.get(\"system.categories\")\ndef sysname = hostProps.get(\"system.sysname\")\nif (categories.contains(\"Cisco_FTD\") && sysname) {\n l2Eri << sysname\n}\n\n// Check if device is an HSRP supporting router\ntry {\n def props = hostProps.toProperties()\n def hsrpState = Snmp.walkAsMap(host, \"1.3.6.1.4.1.9.9.106.1.2.1.1.15\", props).find { true }?.value // cHsrpGrpStandbyState - standby(5), active(6)\n if (hsrpState) {\n\n // And we can build ERI using each non HSRP MAC appended to the active or standby HSRP MAC\n def hsrpVirtualMacs = Snmp.walkAsMap(host, \"1.3.6.1.4.1.9.9.106.1.2.1.1.16\", props) \n if (hsrpVirtualMacs && hsrpVirtualMacs.size() >= 2) {\n\n def routerMacs = l2Eri.findAll { lmtopo.isMac(it, lmtopoData.blockedKeys, debug) }\n\n // If active, then use active HSRP MAC in the ERI\n if (hsrpState == \"6\") { \n def cHsrpGrpActiveRouter = Snmp.walkAsMap(host, \"1.3.6.1.4.1.9.9.106.1.2.1.1.13\", props).find { true }?.value // cHsrpGrpActiveRouter\n if (cHsrpGrpActiveRouter) {\n hsrpEri << cHsrpGrpActiveRouter + \"--HSRP--active\"\n } \n routerMacs.each { nonHsrpMac ->\n hsrpEri << nonHsrpMac + \"--\" + hsrpVirtualMacs.values()[0]\n }\n\n // If standby, then use standby HSRP MAC in the ERI\n } else if (hsrpState == \"5\") {\n def cHsrpGrpStandbyRouter = Snmp.walkAsMap(host, \"1.3.6.1.4.1.9.9.106.1.2.1.1.14\", props).find { true }?.value // cHsrpGrpStandbyRouter\n if (cHsrpGrpStandbyRouter) {\n hsrpEri << cHsrpGrpStandbyRouter + \"--HSRP--standby\"\n } \n routerMacs.each { nonHsrpMac ->\n hsrpEri << nonHsrpMac + \"--\" + hsrpVirtualMacs.values()[1]\n } \n }\n }\n }\n\n} catch (IOException e) {if (debug) println e}\n\ndef eriArray = new JSONArray()\nlmtopo.emitEri(\"net.l2\", 2, l2Eri, ert, eriArray)\nlmtopo.emitEri(\"cluster.hsrp\", 1, hsrpEri, ert, eriArray)\nlmtopo.printEriArray(eriArray, keyNamespace, keyBlacklist)\n\nreturn 0"}, "propertySourceType": 1, "collectionInterval": 43200}

×PropertySource: addERI_Kubernetes_Node (112)

{"name": "addERI_Kubernetes_Node", "appliesTo": "hasCategory(\"KubernetesNode\")", "description": "Sets node name External Resource IDs (ERIs) for Kubernetes Nodes.\nRequires collector version 30.000 or greater.", "group": "ERI", "searchKeywords": "kubernetes,node,topology", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport org.json.JSONArray\n\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\nlmtopo = modLoader.load(\"lm.topo\", \"0\")\n\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\ndef ert = \"Node\"\n\ndef nodeEri = []\n\ndef node_selflink = null\nnode_selflink = hostProps.get(\"auto.selflink\")\nif (node_selflink != null) {\n nodeEri << node_selflink\n}\n\ndef eriArray = new JSONArray()\nlmtopo.emitEri(\"k8\", 1, nodeEri, ert, eriArray)\nlmtopo.printEriArray(eriArray, keyNamespace, keyBlacklist)\n\nreturn 0"}, "propertySourceType": 1, "collectionInterval": 1800}

×PropertySource: addERI_Kubernetes_Pod (111)

{"name": "addERI_Kubernetes_Pod", "appliesTo": "hasCategory(\"KubernetesPod\")", "description": "Sets pod name External Resource IDs (ERIs) for Kubernetes Pods.\nRequires collector version 30.000 or greater.", "group": "ERI", "searchKeywords": "kubernetes,pod,topology", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport org.json.JSONArray\n\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\nlmtopo = modLoader.load(\"lm.topo\", \"0\")\n\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\ndef ert = \"Pod\"\n\ndef podEri = []\n\ndef pod_selflink = null\npod_selflink = hostProps.get(\"auto.selflink\")\nif (pod_selflink != null) {\n podEri << pod_selflink\n}\n\ndef eriArray = new JSONArray()\nlmtopo.emitEri(\"k8\", 1, podEri, ert, eriArray)\nlmtopo.printEriArray(eriArray, keyNamespace, keyBlacklist)\n\nreturn 0"}, "propertySourceType": 1, "collectionInterval": 1800}

×PropertySource: addERI_Kubernetes_Service (110)

{"name": "addERI_Kubernetes_Service", "appliesTo": "hasCategory(\"KubernetesService\")", "description": "Sets service name External Resource IDs (ERIs) for Kubernetes Services.\nRequires collector version 30.000 or greater.", "group": "ERI", "searchKeywords": "kubernetes,service,topology", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport org.json.JSONArray\n\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\nlmtopo = modLoader.load(\"lm.topo\", \"0\")\n\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\ndef ert = \"Service\"\n\ndef serviceEri = []\n\ndef service_selflink = null\nservice_selflink = hostProps.get(\"auto.selflink\")\nif (service_selflink != null) {\n serviceEri << service_selflink\n}\n\ndef eriArray = new JSONArray()\nlmtopo.emitEri(\"k8\", 1, serviceEri, ert, eriArray)\nlmtopo.printEriArray(eriArray, keyNamespace, keyBlacklist)\n\nreturn 0"}, "propertySourceType": 1, "collectionInterval": 1800}

×PropertySource: addERI_PaloAlto (89)

{"name": "addERI_PaloAlto", "appliesTo": "hasCategory(\"PaloAlto\")", "description": "Sets device External Resource IDs (ERIs) for layer 2 topology mapping, including LLDP local system name using LLDP-MIB and MAC addresses using RFC1213-MIB. \n\nSets ERI Type by parsing the device's layered system services using SYS-MIB, defaults to \"Unknown\" if not determined.\nRequires collector version 30.000 or greater.", "group": "ERI", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport org.json.JSONArray\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\nlmtopo = modLoader.load(\"lm.topo\", \"0\")\nlmtopoSnmp = modLoader.load(\"lm.topo.snmp\", \"0\")\nlmtopoData = modLoader.load(\"lm.data.topo\", \"0\")\nlmtopoData.run()\n\ndef host = hostProps.get(\"system.hostname\")\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\ndef debug = false\n\ndef timeout = 300000\n\ndef ert = \"Firewall\"\n\ndef l2Eri = []\ndef haEri = []\n\ndef lldpLocalChassisId = lmtopoSnmp.getLldpLocalChassisId(host, debug)\nlmtopo.processLLDPLocalChassisId(lldpLocalChassisId, lmtopoData.blockedKeys, l2Eri, debug) \n\ndef ifTable = lmtopoSnmp.extractInterfaces(host, null, timeout, debug)\nlmtopo.processIntefaceTable(ifTable, lmtopoData.blockedInterfaceNames, lmtopoData.blockedInterfaceTypes, lmtopoData.blockedKeys, l2Eri, debug)\n\ndef haMacPrefixes = [\"b4:0c:25:e\", \"00:1b:17:00\"]\ndef haState = Snmp.get(host, \"1.3.6.1.4.1.25461.2.1.2.1.11.0\")\ndef haMode = Snmp.get(host, \"1.3.6.1.4.1.25461.2.1.2.1.13.0\")\ndef isActive = haState == \"active\" && haMode == \"active-passive\"\n\ndef instanceInterfaces = []\n\ndef found = false\n\nifTable.values().each { ifEntry ->\n\n def macAddr = ifEntry.mac\n def ifName = ifEntry.name\n\n if (ifName.contains(\"ha\") || ifName == \"mgmt\" && isActive) {\n instanceInterfaces << macAddr\n\n } else if (!found && haMacPrefixes.find { macAddr.startsWith(it)}) {\n\n // Salt ha mac with ip address prefix\n def ips = hostProps.get(\"system.ips\").tokenize(\",\")\n if (ips && ips.size > 0) {\n def firstIp = ips[0]\n if (firstIp.tokenize(\".\").size() == 4) {\n def ipPrefix = firstIp.tokenize(\".\")[0..2].join(\".\")\n def paHaERI = \"pa--${haState}--${ipPrefix}--${macAddr}\" \n if (debug) println \"Palo Alto HA ERI: ${paHaERI}\"\n haEri << paHaERI\n found = true\n }\n }\n }\n\n}\n\nl2Eri = l2Eri.findAll { instanceInterfaces.contains(it) }\n\ndef eriArray = new JSONArray()\nlmtopo.emitEri(\"net.l2\", 3, l2Eri, ert, eriArray)\nlmtopo.emitEri(\"cluster.pa\", 1, haEri, ert, eriArray)\nlmtopo.printEriArray(eriArray, keyNamespace, keyBlacklist)\n\nreturn 0"}, "propertySourceType": 1, "collectionInterval": 43200}

×PropertySource: addERI_Netscaler (109)

{"name": "addERI_Netscaler", "appliesTo": "isNetscaler()", "description": "Sets device External Resource IDs (ERIs) for layer 2 topology mapping, including LLDP local system name using LLDP-MIB and MAC addresses using RFC1213-MIB. \n\nSets ERI Type by parsing the device's layered system services using SYS-MIB, defaults to \"Unknown\" if not determined.\nRequires collector version 30.000 or greater.", "group": "ERI", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport org.json.JSONArray\n\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\nlmtopo = modLoader.load(\"lm.topo\", \"0\")\nlmtopoSnmp = modLoader.load(\"lm.topo.snmp\", \"0\")\nlmtopoData = modLoader.load(\"lm.data.topo\", \"0\")\nlmtopoData.run()\n\ndef host = hostProps.get(\"system.hostname\")\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\ndef debug = false\n\ndef timeout = 300000\n\ndef ert = \"LoadBalancer\"\n\ndef l2Eri = []\ndef clusterEri = []\n\ndef lldpLocalChassisId = lmtopoSnmp.getLldpLocalChassisId(host, debug)\nlmtopo.processLLDPLocalChassisId(lldpLocalChassisId, lmtopoData.blockedKeys, l2Eri, debug) \n\ndef ifTable = lmtopoSnmp.extractInterfaces(host, null, timeout, debug)\nlmtopo.processIntefaceTable(ifTable, lmtopoData.blockedInterfaceNames, lmtopoData.blockedInterfaceTypes, lmtopoData.blockedKeys, l2Eri, debug)\n\ndef haMode = Snmp.get(host, \".1.3.6.1.4.1.5951.4.1.1.6.0\") // sysHighAvailabilityMode\n\n/* \nIP address type \n netScalerIp(1), \n mappedIp (2), \n subnetIp (4) \nIP address status \n active (1), \n passive (2) \n*/\nif ([\"1\", \"2\"].contains(haMode)) {\n\n def nsIpMode = Snmp.walkAsMap(host, \"1.3.6.1.4.1.5951.4.1.1.26.1.4\", null, 60000) // ipMode\n\n snipAddresses = []\n nsipAddresses = []\n\n Snmp.walkAsMap(host, \"1.3.6.1.4.1.5951.4.1.1.26.1.3\", null, 60000).each { ipAddr, ipType -> // ipTypes\n\n \tipMode = nsIpMode.get(ipAddr)\n \t\n \tif(ipType == \"1\" && ipMode == \"1\") nsipAddresses << ipAddr\n \tif (ipType == \"4\") snipAddresses << ipAddr\n }\n\n nsipAddresses.each { nsip ->\n \tsnipAddresses.each{ snip ->\n \t clusterEri << \"ns:${nsip}--${snip}\" // Use netScalerIp--subnetIp as cluster ERI\n \t}\n }\n}\n\ndef eriArray = new JSONArray()\nlmtopo.emitEri(\"net.l2\", 2, l2Eri, ert, eriArray)\nlmtopo.emitEri(\"cluster.netscaler\", 1, clusterEri, ert, eriArray)\nlmtopo.printEriArray(eriArray, keyNamespace, keyBlacklist)\n\nreturn 0"}, "propertySourceType": 1, "collectionInterval": 43200}

×PropertySource: Oracle_Database_Names (131)

{"name": "Oracle_Database_Names", "appliesTo": "hasCategory(\"OracleDB\") && ((isLinux() && ssh.user) || hasCategory(\"Linux_SSH\") || isWindows())", "description": "Adds the database names for oracle databases installed on a single server. \n\nRequirements:\n - Windows: WMI configured and wmi.user and wmi.pass\n - Linux: ssh.user and ssh.pass", "group": "Oracle", "searchKeywords": "database,oracle", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.jcraft.jsch.JSch\nimport com.santaba.agent.groovyapi.win32.WMI\nimport com.santaba.agent.util.Settings\n\ndef platform = hostProps.get(\"system.sysinfo\")\ndef kernel_name = hostProps.get(\"auto.linux.kernel.name\")\ndef host = hostProps.get(\"system.hostname\")\ndef dbNames = []\n\nif (platform.toString().toLowerCase().contains('linux') || kernel_name.toString().toLowerCase().contains('linux')) {\n\n def user = hostProps.get(\"ssh.user\")\n def pass = hostProps.get(\"ssh.pass\")\n def port = hostProps.get(\"ssh.port\")?.toInteger() ?: 22\n def cert = hostProps.get(\"ssh.cert\") ?: '~/.ssh/id_rsa'\n def timeout = 15000 // timeout in milliseconds\n\n try {\n // command to output all information about the Linux host.\n // the regex ignores comment lines https://kvz.io/blog/2007/07/11/cat-a-file-without-the-comments/\n def readOratab_cmd = \"cat /etc/oratab| egrep -v \\\"^\\\\s*(#|\\$)\\\" ;\"\n\n def command_output = getCommandOutput(host, user, pass, cert, port, timeout, readOratab_cmd)\n def output = \"oracle.dbnames=\"\n\n // Did our output contain the word linux ?\n if (command_output != null) {\n\n dbNames = command_output.split('\\n')\n def i = 0\n dbNames.each {\n //store each line in the string. Needed this to use indexOf() command\n workString = it.toString()\n output = output + ((i > 0) ? \",\" : \"\")\n output = output + workString.substring(0, workString.indexOf(':'))\n i++\n }\n\n println output\n } else {\n println \"Unexpected Exception: /etc/oratab file not found or SSH login refused\"\n return 1\n }\n\n return 0\n }\n catch (Exception e) {\n println \"Unexpected Exception : \" + e\n return 1\n }\n} else {\n\n def DBnames = []\n\n // Form the full query.\n def wmiQuery = 'Select name,state from Win32_Service Where Name like \\\"OracleService%\\\"'\n\n try {\n // using default namespace\n def session = WMI.open(host)\n def result = session.queryAll(\"CIMv2\", wmiQuery, 10)\n\n result.each { data -> DBnames.add(data.NAME.replace('OracleService', ''))\n }\n\n // Yes, apply the properties\n println 'oracle.dbnames=' + DBnames.join(', ')\n\n }\n\n catch (Exception e) {\n println e\n return 1\n }\n\n // Exit by returning 0.\n return 0\n\n}\n\n/**\n * Helper method which handles creating JSCH session and executing commands\n * @return\n */\ndef getCommandOutput(host, user, pass, cert, port, timeout, String input_command) {\n try {\n // instantiate JSCH object.\n jsch = new JSch()\n\n // do we have an user and no pass ?\n if (user && !pass) {\n // Yes, so lets try connecting via cert.\n jsch.addIdentity(cert)\n }\n\n // create session.\n session = jsch.getSession(user, host, port)\n\n\n // given we are running non-interactively, we will automatically accept new host keys.\n session.setConfig(\"StrictHostKeyChecking\", \"no\")\n String authMethod = Settings.getSetting(Settings.SSH_PREFEREDAUTHENTICATION, Settings.DEFAULT_SSH_PREFEREDAUTHENTICATION)\n session.setConfig(\"PreferredAuthentications\", authMethod)\n\n // set session timeout, in milliseconds.\n session.setTimeout(timeout)\n\n // is host configured with a user & password?\n if (pass) {\n // set password.\n session.setPassword(pass)\n }\n\n // connect\n session.connect()\n\n // execute command.\n channel = session.openChannel(\"exec\")\n channel.setCommand(input_command)\n\n // collect command output.\n def commandOutput = channel.getInputStream()\n channel.connect()\n\n def output = commandOutput.text\n\n // disconnect\n channel.disconnect()\n\n return output\n }\n catch (Exception e) {\n println e\n e.printStackTrace()\n\n }\n // ensure we disconnect the session.\n finally {\n session.disconnect()\n }\n}"}, "propertySourceType": 0}

×PropertySource: addCategory_CiscoTransceiversCLI (199)

{"name": "addCategory_CiscoTransceiversCLI", "appliesTo": "(isCisco() && ssh.user && ssh.pass) && !hasCategory(\"CiscoTransceiverCLI\")", "description": "Identifies if the device supports collecting information on Cisco Transceivers and sets a system category of 'CiscoTransceiverCLI'\n\nRequirements:\n- Identified as a Cisco host.\n- ssh.user & ssh.pass configured", "group": "Cisco", "searchKeywords": "cli,cisco,network", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.groovyapi.expect.Expect\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\") ?: hostProps.get(\"config.user\")\ndef pass = hostProps.get(\"ssh.pass\") ?: hostProps.get(\"config.pass\")\ndef port = hostProps.get(\"ssh.port\") ?: 22\n\ndef cli\ndef timeout = 10\ndef success = false\ndef error = \"\"\n\n// We remove common characters used to decorate a terminal.\ndef termClean = /(.?\\[\\?7h)/\ndef rawPrompt = /(?-m)[^\\n\\s]*[>#$]\\s*$/\n\n// CLI based approaches fail often. We make up to 10 attempts to connect and retrieve a single byte of data.\ndef retries = 0\nwhile (retries < 10 && !success) {\n try {\n cli = Expect.open(host, port.toInteger(), user, pass, timeout)\n cli.expect(\".\")\n success = true\n }\n catch (ex) {\n sleep(1000)\n error += \"[Connection Attempt ${retries}] ${ex.message}\\n\"\n }\n\n retries++\n}\n\nif (success) {\n try {\n // At this point we are ready to check for a prompt, but don't know if the device has finished sending data.\n // We wait until the data has been stable for 100 ms. Staggered/Delayed data is reasonably common.\n def outputStability = 0\n def lastLength = -1\n\n while (outputStability < 100) {\n outputStability += (cli.stdout().length() == lastLength) ? 1 : -outputStability\n lastLength = cli.stdout().length()\n sleep(10)\n }\n\n // Now the data is stable, the standard output should have everything we need to gather a prompt.\n def stdPrompt = cli.stdout() =~ rawPrompt.bitwiseNegate()\n def prompt = \"\"\n\n if (stdPrompt.size()) {\n // We've got our best guess at a prompt at this point. Clean it and get it ready for line matching.\n prompt = \"^${termClean}*.?${stdPrompt[0].trim().replaceAll(termClean, '').drop(1).trim().replaceAll(/[.*+?^()|\\[\\]\\\\{}$]/, '\\\\\\\\$0')}\"\n // Consume the buffer expecting the prompt so we know we have a clean buffer to work with for future matches.\n cli.expect(prompt)\n } else {\n // We didn't find a prompt in the standard output. Use expect to wait for one.\n cli.expect(rawPrompt)\n prompt = \"^.?${cli.matched().replaceAll(termClean, '').trim().replaceAll(/[.*+?^()|\\[\\]\\\\{}$]/, '\\\\\\\\$0')}\"\n }\n\n // The enable command may have changed the prompt. We've got to get it again.\n prompt = \"^${cli.matched().replaceAll(termClean, '').trim().replaceAll(/[.*+?^()|\\[\\]\\\\{}$]/, '\\\\\\\\$0')}\"\n\n // We aren't in basic mode so try and configure the terminal to avoid pagination.\n [\"width\", \"length\"].each { dimension ->\n cli.send(\"terminal ${dimension} 0\\n\")\n cli.expect(prompt)\n if (cli.before().trim().readLines().size() > 1) {\n cli.send(\"screen-${dimension} 0\\n\")\n cli.expect(prompt)\n }\n }\n\n // Gather all supported show commands.\n cli.send(\"show interface transceiver details\\n\")\n cli.expect(prompt)\n\n cli.before().trim().split(\"Ethernet\").any {\n if (it.contains(\"----\")) {\n println \"system.categories=CiscoTransceiverCLI\"\n return 1\n }\n }\n } catch (ex) {\n error += \"[Collecting] ${ex.message}\\n\"\n success = false\n }\n\n try {\n // Add an extra exit if we might be in privilege mode.\n cli.send(\"exit\\n\")\n cli.close()\n }\n catch (ex) {\n error += \"[Closing] ${ex.message}\\n\"\n success = false\n }\n}\n\nif (!success) {\n error += cli ? \"--- CLI Output ---\\n${cli.stdout()}\\n\" : \"\"\n error += cli ? \"--- CLI Base64 ---\\n${cli.stdout().bytes.encodeBase64().toString()}\\n\" : \"\"\n println \"--- Error Logs ---\\n${error}\"\n // The following line can be added if diagnostic logs are required.\n //new File(\"../logs/Cisco_Transceiver_Category ${host.replaceAll('[^a-zA-Z0-9-_\\\\.]', '_')}.txt\").write(error)\n return 1\n}\n\nreturn 0"}, "propertySourceType": 0}

×PropertySource: Microsoft_SQLServer_Connections (27)

{"name": "Microsoft_SQLServer_Connections", "appliesTo": "hasCategory(\"mssql\")", "description": "Creates a connection string used by all the datasources to access instances. Also sets the instance name and the browser status. Uses Windows Integrated Security.", "group": "Microsoft SQL Server", "searchKeywords": "sqlserver,microsoft,sql", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.win32.WMI\nimport groovy.sql.Sql\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\n\n// Enable debug mode for troubleshooting purposes. Otherwise, leave false\nBoolean debug = false\nboolean ignoreExistingInstances = false //used to debug. Will ignore if manual instances are set.\n\nString host = hostProps.get(\"system.hostname\")\nString integratedSecurity = hostProps.get(\"mssql.integrated_security\")\nString systemCategories = hostProps.get(\"system.categories\")?:\"\"\nboolean clusterServer = false\nString jdbcUser = hostProps.get(\"jdbc.mssql.user\") ?: \"\"\nString jdbcPass = hostProps.get(\"jdbc.mssql.pass\") ?: \"\"\nString autoSqlInstances = hostProps.get(\"auto.sql_server_instances\") ?: \"\"\nString wmiEnabled = hostProps.get(\"auto.wmi.operational\") ?: \"true\" //assume it's true if it doesn't exist\nString mssqlPort = hostProps.get(\"jdbc.mssql.port\") ?: '1433'\nInteger wmiTimeout = 15\nInteger sqlTimeout = 5\n\nmodLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\ndef lmDebug = modLoader.load(\"lm.debug\", \"0\") // Load LM emit module\n\nList openPorts = openSockets(mssqlPort, host, lmDebug, debug) // check the ports to see what's open\n\nif (systemCategories.contains(\"WSFC_VNN\"))\n{\n clusterServer = true\n}\n\n\nBoolean isWindows = (hostProps.get(\"system.sysinfo\") ?: '').toLowerCase().contains(\"windows\") ? true : false\nlmDebug.LMDebugPrint(hostProps.get(\"system.sysinfo\"), debug)\n\ndef returnProps = [:] // variable that contains all the properties to assign to the resource\n\n// Is this a Windows or Linux host ?\n// for windows we can use many more options. There's no integrated security for Linux.\nif (isWindows)\n{\n def manualSQLinstances = hostProps.get(\"mssql.sql_server_instances\")\n // check to see if there are manually named instances\n ArrayList windowsSQLinstances\n if ((manualSQLinstances || manualSQLinstances == \"\") && !ignoreExistingInstances)\n {\n windowsSQLinstances = manualSQLinstances.toString().tokenize(\",\")\n }\n else if (clusterServer)\n {\n def clusterSQLinstances = hostProps.get(\"wsfc.SQLInstanceNames\") ?: hostProps.get(\"auto.wsfc.SQLInstanceNames\") ?: \"\"\n //manually set SQLInstance Names override the auto props\n windowsSQLinstances = clusterSQLinstances.toString().tokenize(\",\")\n }\n else\n {\n if (wmiEnabled)\n {\n windowsSQLinstances = getWindowsSQLInstances(host, autoSqlInstances, lmDebug, wmiTimeout, debug)\n }\n }\n lmDebug.LMDebugPrint(\"****** SQL Server Instance Names May be over-ridden by properties.get(mssql.sql_server_instances) : $windowsSQLinstances\", debug)\n // stage all of the discovered SQL Server Instances for output.\n if (windowsSQLinstances)\n {\n // Count the number of SQL instances. If there is only one instance then do something different.....\n def numberOfInstances = windowsSQLinstances.size()\n windowsSQLinstances.each() {sqlInstance ->\n\n if (returnProps[\"sql_server_instances\"])\n {\n returnProps[\"sql_server_instances\"] = returnProps[\"sql_server_instances\"] + \",\" + sqlInstance\n }\n else\n {\n returnProps[\"sql_server_instances\"] = sqlInstance\n }\n if (hostProps.get(\"mssql.${sqlInstance.trim().toLowerCase()}.mssql_url\") && !ignoreExistingInstances)\n {\n // you're done. Manually set url and we'll always use that. The troubleshooter will check it for problems.\n lmDebug.LMDebugPrint(\"Manually set url so nothing to do\", debug)\n }\n else\n {\n def connectionString = checkConnectionString(host, sqlInstance.trim(), hostProps, numberOfInstances, clusterServer, sqlTimeout , openPorts, lmDebug, debug)\n if (connectionString != null)\n {\n returnProps[\"${sqlInstance.trim().toLowerCase().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}.mssql_url\"] = connectionString\n }\n }\n }\n }\n else if (!clusterServer) // no windows instances are found. Try the ports and see if anything is there. Don't do this on a cluster server\n {\n returnProps = noInstanceNames(hostProps, host, returnProps, lmDebug,sqlTimeout, debug)\n // this will add to returnProps if there is anything on the ports. It will query the SQL server to find things.\n }\n}\n\nreturnProps.each { property, value ->\n if (value)\n {\n println(\"${property.toLowerCase()}=${value}\")\n }\n}\nlmDebug.LMDebugPrint(\"Output Properties: $returnProps\", debug)\nreturn 0\n\n\n/**\n * Helper method which gathers MS SQL Server named instances via WMI. Named instances in the JDBC connection when\n * integrated security is true\n * @pa\n * @param debug\n * @return List of discovered SQL Server instances.\n */\ndef getWindowsSQLInstances(host, autoSqlInstances, lmDebug, wmiTimeout = 10, debug = false)\n{\n lmDebug.LMDebugPrint(\"\\n**** GETTING MS SQL Server named INSTANCES ****\", debug)\n ArrayList instancesToIgnore = [\"MSSQL\\$MICROSOFT##SSEE\"]\n ArrayList discoveredSqlInstances = []\n ArrayList ouputInstanceState = []\n // Try the following code.\n try\n {\n // instantiate the WMI class object\n def wmi_output = WMI.queryAll(host, \"select NAME, DISPLAYNAME from Win32_Service where PATHNAME like '%sqlservr.exe%'\", wmiTimeout)\n // If we got wmi output, continue.\n if (wmi_output)\n {\n // iterate through all our services output.\n wmi_output.each { output ->\n if (!instancesToIgnore.find { it == output['NAME'] })\n {\n //secondary instances start with MSSQL$ and we don't want that in the name\n discoveredSqlInstances.push(output['NAME'].substring(output['NAME'].indexOf('\\$') + 1))\n }\n\n }\n lmDebug.LMDebugPrint(\"\\tDEBUG: Discovered the following SQL Server instances - ${discoveredSqlInstances}.\", debug)\n }\n }\n catch (Exception e)\n {\n // Print exception. Don't allow this to crash the program since we have other methods for finding connections strings.\n lmDebug.LMDebugPrint(\"\\t*EXCEPTION*: Ran into exception while attempting to discover SQL Server instances via WMI. ${e.message}\", debug)\n return null\n }\n return discoveredSqlInstances\n}\n\n\n/**\n * Designed to return a connection String. It loops through all possible connection strings until if finds one that works.\n * Made specifically for SQLAuth Connections.\n * @param host\n * @param user\n * @param pass\n * @param windowsSQLinstances\n * @param mssql_port\n * @param debug\n * @return\n */\n\nString checkConnectionString(String host,String windowsSQLinstance,def hostProps, Integer numberOfInstances = 1, Boolean clusterServer = false, Integer sqlTimeout, List openPorts , def lmDebug ,Boolean debug = false)\n{\n def user = hostProps.get(\"mssql.${windowsSQLinstance}.user\") ?: hostProps.get(\"jdbc.mssql.user\") ?: ''\n def pass = hostProps.get(\"mssql.${windowsSQLinstance}.pass\") ?: hostProps.get(\"jdbc.mssql.pass\") ?: ''\n def integratedSecurity = hostProps.get(\"mssql.${windowsSQLinstance}.integrated_security\")?: hostProps.get(\"mssql.integrated_security\")?:\"\"\n\n String mssqlInstancePort = hostProps.get(\"mssql.${windowsSQLinstance}.port\")\n String mssqlConnectionString = hostProps.get(\"mssql.${windowsSQLinstance.trim()}.mssql_url\")?:hostProps.get(\"auto.${windowsSQLinstance.trim()}.mssql_url\")\n String useIntegratedSecurity\n def result = null\n //test existing SQL connection string. If it works then return and skip everything else\n if (mssqlConnectionString?:false)\n {\n def conn = attemptConnection(user, pass, mssqlConnectionString,lmDebug, debug)\n if (conn.status == \"success\")\n {\n return mssqlConnectionString\n }\n\n }\n\n // if there is an SQL instance port then it overrides all other ports.\n if (mssqlInstancePort){\n openPorts = [mssqlInstancePort]\n }\n // Check to see if we should use windows integrated security or SQL securtity\n if (integratedSecurity.toLowerCase() == 'false') {\n useIntegratedSecurity= 'false'\n }\n else if (integratedSecurity.toLowerCase() == 'true') //if the user insists on integrated security then use it.\n {\n useIntegratedSecurity = 'true'\n }\n else if (user != \"\" ) // if there is no jdbc user then integrated security must be used\n {\n useIntegratedSecurity = 'true'\n }\n else\n {\n useIntegratedSecurity = 'true' // default to true\n }\n\n ArrayList test_urls_and_params_list = []\n // don't do anything for this database instance name.\n\n lmDebug.LMDebugPrint(\"\\n**** CHECKING SQL SECURITY ****\", debug)\n lmDebug.LMDebugPrint(\"\\tReceived the following method parameters:\", debug)\n lmDebug.LMDebugPrint(\"\\t- Host: ${host}\", debug)\n lmDebug.LMDebugPrint(\"\\t- User: ${user}\", debug)\n lmDebug.LMDebugPrint(\"\\t- Integrated security = ${useIntegratedSecurity}\",debug)\n lmDebug.LMDebugPrint(\"\\t- Windows SQL Instance: ${windowsSQLinstance}\", debug)\n lmDebug.LMDebugPrint(\"\\t- MSSQL Ports: ${openPorts}\", debug)\n lmDebug.LMDebugPrint(\"\\n\", debug)\n\n /*\n __________________________________________________________\n Authentication / JDBC Connecting String Variations:\n https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-2017\n - When no port or instance name is specified, MS SQL JDBC connection defaults to 1433.\n */\n\n // For windows failover cluster servers the format of the connection string is different\n if (clusterServer)\n {\n String wsfcPort = hostProps.get(\"auto.wsfc.port.${windowsSQLinstance.toLowerCase()}\")\n if (wsfcPort)\n {\n test_urls_and_params_list.push([\"${windowsSQLinstance.trim()}.mssql_url\": \"jdbc:sqlserver://${windowsSQLinstance}:${wsfcPort};integratedSecurity=${useIntegratedSecurity};applicationIntent=ReadOnly;multiSubnetFailover=true;logintimeout=${sqlTimeout}\"])\n }\n else\n {\n test_urls_and_params_list.push([\"${windowsSQLinstance.trim()}.mssql_url\": \"jdbc:sqlserver://${windowsSQLinstance};integratedSecurity=${useIntegratedSecurity};applicationIntent=ReadOnly;multiSubnetFailover=true;logintimeout=${sqlTimeout}\"])\n }\n openPorts.each() { portNum ->\n //https://docs.microsoft.com/en-us/sql/connect/jdbc/working-with-a-connection?view=sql-server-ver15\n test_urls_and_params_list.push([\"${windowsSQLinstance.trim()}.mssql_url\": \"jdbc:sqlserver://${host}:${portNum};instanceName=${windowsSQLinstance};integratedSecurity=${useIntegratedSecurity};applicationIntent=ReadOnly;multiSubnetFailover=true;logintimeout=${sqlTimeout}\"])\n }\n }\n else\n {\n test_urls_and_params_list.push([\"${windowsSQLinstance.trim()}.mssql_url\": \"jdbc:sqlserver://${host};instanceName=${windowsSQLinstance};integratedSecurity=${useIntegratedSecurity};applicationIntent=ReadOnly;logintimeout=${sqlTimeout}\"])\n if (numberOfInstances == 1)\n {\n test_urls_and_params_list.push([\"${windowsSQLinstance.trim()}.mssql_url\": \"jdbc:sqlserver://${host};integratedSecurity=${useIntegratedSecurity};applicationIntent=ReadOnly;logintimeout=${sqlTimeout}\"])\n }\n openPorts.each() { portNum ->\n // manually configured port with and integrated security\n test_urls_and_params_list.push([\"${windowsSQLinstance.trim()}.mssql_url\": \"jdbc:sqlserver://${host}:${portNum};integratedSecurity=${useIntegratedSecurity};applicationIntent=ReadOnly;logintimeout=${sqlTimeout}\"])\n }\n }\n\n // iterate through the URL's and return when we find a valid one\n test_urls_and_params_list.each { params ->\n\n if (result)\n {\n lmDebug.LMDebugPrint(\" Avoiding calling \" + params.get(\"${windowsSQLinstance.trim()}.mssql_url\") + \" because we already found settings that work\", debug)\n return\n }\n else\n {\n // test for successful output\n def conn = attemptConnection(user, pass, params.get(\"${windowsSQLinstance.trim()}.mssql_url\"), lmDebug,debug)\n if (conn.status == \"success\")\n {\n testQuery = runQuery(\"Select @@servicename as instancename\", conn.connection,lmDebug, debug)\n if (testQuery.status == \"success\")\n {\n result = params.get(\"${windowsSQLinstance.trim()}.mssql_url\")\n lmDebug.LMDebugPrint(\"\\tDEBUG: Successfully executed query with the following URL - \" + params.get(\"${windowsSQLinstance.trim()}.mssql_url\").toString() + \"\", debug)\n }\n\n conn.connection.close()\n }\n else\n {\n lmDebug.LMDebugPrint(\"\\tDEBUG: Failed to execute query with the following URL - \" + params.get(\"${windowsSQLinstance.trim()}.mssql_url\").toString() + \"\", debug)\n }\n }\n }\n\n lmDebug.LMDebugPrint(\"\\tDEBUG: These are all the URL's tested: $test_urls_and_params_list\", debug)\n lmDebug.LMDebugPrint(\"\\tDEBUG: Returning a MAP with the following values. \", debug)\n // lmDebug.LMDebugPrint(\"\\t- integrated_security: ${result?.integrated_security}\", debug)\n\n // Return map of boolean values for integrated_security, use_named_instance and use_ports\n return result\n}\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(String instanceUser, String instancePass, String instanceURL, def lmDebug, Boolean debug = false)\n{\n lmDebug.LMDebugPrint(\"**** Props to connect:\", debug)\n lmDebug.LMDebugPrint(\"\\tuser:$instanceUser\", debug)\n lmDebug.LMDebugPrint(\"\\tinstanceURL:$instanceURL\", debug)\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n String driver = \"com.microsoft.sqlserver.jdbc.SQLServerDriver\"\n db_connection = Sql.newInstance(instanceURL, instanceUser, instancePass, driver)\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n lmDebug.LMDebugPrint(\"***** Attempt Connection error: ${e.message}\", debug)\n connComplete = false\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true)\n {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n returnArray['connection'] = null\n }\n\n return returnArray\n}\n\n/**\n * input list of comma separated ports like this: 1433, 1521, 60000\n * returns a map with ports that respond\n */\ndef openSockets(String portsCheck, String hostCheck, def lmDebug , Boolean debug)\n{\n List livePorts = []\n portsCheck.tokenize(',').each { port ->\n if (port.isNumber())\n {\n try\n {\n lmDebug.LMDebugPrint(\"\\n Trying Port \" + port, debug)\n def socket = new Socket()\n // timeout from the attempt connection through JDBC is too long. Check to see if the socket is open first.\n // Attempt a connection to our host and port with a one second timeout.\n socket.connect(new InetSocketAddress(hostCheck, port.toInteger()), 1000)\n // It succeeded, Close the socket.\n socket.close()\n livePorts.push(port.trim())\n }\n catch (Exception e)\n {\n\n lmDebug.LMDebugPrint(\"***** Open Sockets Error: $e \", debug)\n }\n }\n }\n\n return livePorts\n}\n\n/**\n * Test systems with only port numbers and no instance names. Integrated security only\n * A linux instance will run on a particular port. The command string is simple with no integrated security connections\n * inputs\n * @host Hostname for the machine to be tested\n * @ports List of ports used by SQL. These have already been checked if they are open on the target machine\n * @debug used for debug print operations\n * @returns List of connection strings to try.\n *\n */\n\ndef noInstanceNames(hostProps, host, returnProps, def lmDebug, Integer sqlTimeout, boolean debug)\n{\n def mssql_port = hostProps.get(\"jdbc.mssql.port\") ?: '1433'\n List openPorts = openSockets(mssql_port, host,lmDebug, debug)\n lmDebug.LMDebugPrint(\"Here are the open ports: \" + openPorts, debug)\n def windowsSQLinstances = []\n\n if (openPorts)\n {\n // This section will try ports with integrated security. This is almost a last ditch effort.\n openPorts.each() { portnum ->\n String connectString = \"jdbc:sqlserver://${host}:${portnum};multiSubnetFailover=true;integratedSecurity=true;loginTimeout=3\"\n lmDebug.LMDebugPrint(\"\\n connection string: \" + connectString, debug)\n def conn = attemptConnection(\"\", \"\", connectString,lmDebug, debug) //integrated security doesn't need a user\n if (conn.status == 'success')\n {\n try\n {\n def cstmt = conn.connection.prepareCall(\"select @@servicename as name\")\n def rs = cstmt.executeQuery()\n def instanceNameFromDB = \"\"\n // there is probably a better way to do this\n while (rs.next())\n {\n instanceNameFromDB = rs.getString(\"name\")\n }\n returnProps[\"${instanceNameFromDB}_${portnum}.mssql_url\"] = connectString\n windowsSQLinstances.push(\"${instanceNameFromDB}_${portnum}\")\n }\n catch (Exception e)\n {\n lmDebug.LMDebugPrint(\"Can't do this $e.message\", debug)\n returnProps[\"port_${portnum}.mssql_url\"] = connectString\n windowsSQLinstances.push(\"port_${portnum}\")\n }\n conn.connection.close()\n }\n }\n returnProps[\"sql_server_instances\"] = windowsSQLinstances.join(\",\")\n }\n else\n {\n // This section will try integrated security without a port. This is the last ditch effort and will probably never work.\n String connectString = \"jdbc:sqlserver://${host};multiSubnetFailover=true;integratedSecurity=true;logintimeout=${sqlTimeout}\"\n lmDebug.LMDebugPrint(\"\\n connection string: \" + connectString, debug)\n def conn = attemptConnection(\"\", \"\", connectString,lmDebug, debug) //integrated security doesn't need a user\n if (conn.status == 'success')\n {\n try\n {\n def cstmt = conn.connection.prepareCall(\"select @@servicename as name\")\n def rs = cstmt.executeQuery()\n def instanceNameFromDB = \"\"\n //there is probably a better way to do this\n while (rs.next())\n {\n instanceNameFromDB = rs.getString(\"name\")\n }\n returnProps[\"${instanceNameFromDB}_${portnum}.mssql_url\"] = connectString\n windowsSQLinstances.push(\"${instanceNameFromDB}_${portnum}\")\n }\n catch (Exception e)\n {\n lmDebug.LMDebugPrint(\"Can't do this $e.message\", debug)\n returnProps[\"port_${portnum}.mssql_url\"] = connectString\n windowsSQLinstances.push(\"port_${portnum}\")\n }\n conn.connection.close()\n }\n returnProps[\"sql_server_instances\"] = windowsSQLinstances.join(\",\")\n lmDebug.LMDebugPrint(\"Error: Must have jdbc.mssql.user and jdbc.mssql.pass for Linux\", debug)\n }\n\n return returnProps\n}\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\n\ndef runQuery(String sqlQuery, def conn, def lmDebug, debug = false)\n{\n def returnArray = [:]\n lmDebug.LMDebugPrint(\"****Running Query****\", debug)\n lmDebug.LMDebugPrint(\"\\tQuery to run: $sqlQuery\", debug)\n // query the Oracle DB.\n try\n {\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] = 'failed'\n lmDebug.LMDebugPrint(\"\\tSQL Query Error message: ${e.message}\", debug)\n }\n lmDebug.LMDebugPrint(\"Data Returned: ${returnArray.data}\", debug)\n return returnArray\n}"}, "propertySourceType": 0}

×PropertySource: addCategory_MicrosoftExchange_PowerShell (211)

{"name": "addCategory_MicrosoftExchange_PowerShell", "appliesTo": "isWindows() && system.collectorplatform == \"windows\"", "description": "Uses either remote PowerShell rather or creates a CIM session to find the installed version of Microsoft Exchange Server.\n\nThis PropertySource only runs if the host is being monitored using a Windows collector.", "group": "Microsoft Exchange", "searchKeywords": "server,powershell,exchange,microsoft", "script": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$wmi_user = @'\n##WMI.USER##\n'@\n$hostname = '##SYSTEM.HOSTNAME##'\n$collectorName = hostname\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\") {\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName\n}\n\n$scriptblock = {\n $Uninstall_HKLM_Output = Get-ItemProperty \"HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*\" | Select-Object DisplayName, DisplayVersion\n\n foreach ($Uninstall_HKLM_Output in $Uninstall_HKLM_Output) {\n # If we find a matching DisplayName then get the DisplayName and the DisplayVersion exclusive of (\"*Language*\" to exclude Language Packs)\n if ($Uninstall_HKLM_Output.DisplayName -And ($Uninstall_HKLM_Output.DisplayName -Like \"Microsoft Exchange Server*\" -And $Uninstall_HKLM_Output.DisplayName -NotLike \"*Language*\" )) {\n $BuildNumber = $Uninstall_HKLM_Output.DisplayVersion\n switch ($Uninstall_HKLM_Output.DisplayName) {\n { $_ -like \"Microsoft Exchange Server 2019*\" } {\n $AddVersion = \"auto.microsoft.exchange.version=Microsoft Exchange 2019\"\n $AddSystemCategories = \"system.categories=MicrosoftExchange2019\"\n break\n }\n { $_ -like \"Microsoft Exchange Server 2016*\" } {\n $AddVersion = \"auto.microsoft.exchange.version=Microsoft Exchange 2016\"\n $AddSystemCategories = \"system.categories=MicrosoftExchange2016\"\n break\n }\n { $_ -like \"Microsoft Exchange Server 2013*\" } {\n $AddVersion = \"auto.microsoft.exchange.version=Microsoft Exchange 2013\"\n $AddSystemCategories = \"system.categories=MicrosoftExchange2013\"\n break\n }\n { $_ -like \"Microsoft Exchange Server 2010*\" } {\n $AddVersion = \"auto.microsoft.exchange.version=Microsoft Exchange 2010\"\n $AddSystemCategories = \"system.categories=MicrosoftExchange2010\"\n break\n }\n { $_ -like \"Microsoft Exchange Server 2007*\" } {\n $AddVersion = \"auto.microsoft.exchange.version=Microsoft Exchange 2007\"\n $AddSystemCategories = \"system.categories=MicrosoftExchange2007\"\n break\n }\n }\n }\n }\n if ( $BuildNumber -and $AddSystemCategories -and $AddVersion) {\n Write-Host \"auto.microsoft.exchange.build_number=$BuildNumber\"\n Write-Host $AddSystemCategories\n Write-Host $AddVersion\n }\n}\n$Opt = New-CimSessionOption -Protocol Dcom\n$SessionParams = @{\n ErrorAction = 'Stop'\n SessionOption = $Opt\n}\n$InvokeParams = @{\n ErrorAction = 'Stop'\n Scriptblock = $scriptblock\n}\n\n#-----Determine the type of query to make-----\nif ($hostname -match $collectorName) {\n # are wmi user/pass set -- e.g. are these device props either not substiuted or blank\n}\nelseif (([string]::IsNullOrWhiteSpace($wmi_user) -and [string]::IsNullOrWhiteSpace($wmi_pass)) -or (($wmi_user -like '*WMI.USER*') -and ($wmi_pass -like '*WMI.PASS*'))) {\n $SessionParams.ComputerName = $hostname\n $InvokeParams.ComputerName = $hostname\n}\nelse {\n # yes. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $wmi_pass -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $wmi_user, $remote_pass;\n $SessionParams.ComputerName = $hostname\n $SessionParams.Credential = $remote_credential\n $InvokeParams.ComputerName = $hostname\n $InvokeParams.Credential = $remote_credential\n}\n\n# Fallback method if above fails\ntry {\n if ($hostname -match $collectorName) {\n Invoke-Command @InvokeParams\n }\n elseIf (Test-wsman -ComputerName $hostname -ErrorAction SilentlyContinue) {\n Invoke-Command @InvokeParams\n }\n else {\n $Session = New-CimSession @SessionParams\n\n #check for installed exchange services first\n $checkForRunningExchange = Get-CimInstance -CimSession $Session -Query \"Select Name from Win32_Service WHERE Name like 'MSExchange%'\"\n if ( $checkForRunningExchange.length -NotLike 0 ) {\n\n $ExchangeVersion = Get-CimInstance -CimSession $Session -ClassName Win32_Product | where { $_.name -like 'Microsoft Exchange Server' -and $_.name -notlike '%Language Pack%' }\n if ($ExchangeVersion) {\n $BuildNumber = $ExchangeVersion.Version\n Write-Host \"auto.microsoft.exchange.build_number=$BuildNumber\"\n switch ($ExchangeVersion.Version) {\n { $_ -like \"15.[2].*\" } {\n Write-Host \"system.categories=MicrosoftExchange2019\"\n Write-Host \"auto.microsoft.exchange.version=Microsoft Exchange 2019\"\n break\n }\n { $_ -like \"15.[1].*\" } {\n Write-Host \"system.categories=MicrosoftExchange2016\"\n Write-Host \"auto.microsoft.exchange.version=Microsoft Exchange 2016\"\n break\n }\n { $_ -like \"15.[0].*\" } {\n Write-Host \"system.categories=MicrosoftExchange2013\"\n Write-Host \"auto.microsoft.exchange.version=Microsoft Exchange 2013\"\n break\n }\n { $_ -like \"14.[0|1|2|3].*\" } {\n Write-Host \"system.categories=MicrosoftExchange2010\"\n Write-Host \"auto.microsoft.exchange.version=Microsoft Exchange 2010\"\n break\n }\n { $_ -like \"8.[0|1|2|3].*\" } {\n Write-Host \"system.categories=MicrosoftExchange2007\"\n Write-Host \"auto.microsoft.exchange.version=Microsoft Exchange 2007\"\n break\n }\n }\n }\n }\n }\n}\ncatch {\n # exit code of non 0 will mean the script failed and not overwrite the instances that have already been found\n throw $Error[0].Exception\n exit 1\n}\n\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\nexit 0"}, "propertySourceType": 0}

×PropertySource: addCategory_Cisco_UCS (69)

{"name": "addCategory_Cisco_UCS", "appliesTo": "ucs_api.user && ucs_api.pass", "description": "Sets the appropriate categories for Cisco UCS Managers, Fabric Interconnects, and Integrated Management Controllers.", "group": "Cisco UCS", "searchKeywords": "ucs,manager,fabric interconnect,cisco,unified computing system", "technicalNotes": "These modules require a minimum collector version (30.000) and additonal collector configurations. Review support doc for details: https://www.logicmonitor.com/support/monitoring/networking-firewalls/cisco-ucs-monitoring\nRequires the following host properties:\n- ucs_api.mgmt_host\n- ucs_api.user\n- ucs_api.pass\n", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\nimport com.santaba.agent.util.script.ScriptCache\n\n// To run in debug mode, set to true\ndef debug = false\n// To save collector logs, set to true\ndef log = false\n\ndef host = hostProps.get(\"ucs_api.mgmt_host\") ?: hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ucs_api.user\")\ndef pass = hostProps.get(\"ucs_api.pass\")\ndef port = hostProps.get(\"ucs_api.port\") ?: \"443\"\ndef ips = hostProps.get(\"system.ips\")\n\n// Collector version 30.000 or higher required for script cache and snippets\ndef collectorCache = ScriptCache.getCache()\ndef modLoader\ntry {\n modLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n}\ncatch (Exception e) {\n modLoader = new GroovyShell(getBinding()).parse(Snippets.getLoader())\n}\n\ndef lmUcs = modLoader.load(\"cisco.ucs\", \"0\") // Load Cisco UCS module\n\ndef url = \"http${port == '80' ? '' : 's'}://${host}:${port}/nuova\"\n\ndef cimc_properties = [\n \"dn\" : \"dn\",\n \"serial\" : \"serial\",\n \"vendor\" : \"vendor\",\n \"model\" : \"model\",\n \"hw_revision\" : \"revision\",\n \"associated_service_profile\" : \"assignedToDn\",\n \"memory_voltage_type\" : \"lowVoltageMemory\",\n \"memory_speed\" : \"memorySpeed\",\n \"mfg_time\" : \"mfgTime\",\n \"adaptors\" : \"numOfAdaptors\",\n \"total_cores\" : \"numOfCores\",\n \"cpu_count\" : \"numOfCpus\",\n \"nic_count\" : \"numOfEthHostIfs\",\n \"hba_count\" : \"numOfFcHostIfs\",\n \"threads\" : \"numOfThreads\",\n \"originial_uuid\" : \"originalUuid\",\n \"uuid\" : \"uuid\",\n \"part_number\" : \"partNumber\",\n \"scaling_mode\" : \"scaledMode\",\n \"server_id\" : \"serverId\",\n \"slot_id\" : \"slotId\",\n \"local_id\" : \"localId\",\n \"enclosure_id\" : \"enclosureId\",\n \"asset_tag\" : \"assetTag\",\n \"user_label\" : \"usrLbl\",\n \"chassis_id\" : \"chassisId\",\n]\n\ndef fi_properties = [\n \"dn\" : \"dn\",\n \"serial\" : \"serial\",\n \"vendor\" : \"vendor\",\n \"model\" : \"model\",\n \"hw_revision\" : \"revision\",\n \"expected_mem\" : \"expectedMemory\",\n \"oob_management_ip\" : \"oobIfIp\",\n \"ucs.oob_management_mac\": \"oobIfMac\"\n]\n\n// Get an XML API authentication cookie\n// We avoid using the script cache due to limitations related to SSE and PSs having separate script cache from other modules\ndef loginResponse = lmUcs.login(url, user, pass, debug, log)\ndef cookie\n\nif (loginResponse) {\n cookie = loginResponse[0]\n}\n// If loginResponse has a value of false, something went wrong and we should not continue\nelse {\n println \"Issue occurred with cookie. Run script in debug mode for more information.\"\n lmUcs.LMDebugPrint(\"Cookie not retrieved from function call\", debug)\n lmUcs.LMDebugLog(\"Cookie not retrieved from function call\", log)\n return 1\n}\n\n// Request metrics from the API\ndef mgmt_info = lmUcs.getXMLbyClass(url, \"topSystem\", cookie, false, debug)\ndef emu_check = lmUcs.getXMLbyClass(url, \"aaaSession\", cookie, false, debug)\n\n// Identify which system we are dealing with\ndef system_mode = mgmt_info.topSystem.@mode.toString()\nprintln \"auto.ucs.system_mode=${system_mode}\"\nprintln \"auto.ucs.system_name=${mgmt_info.topSystem.@name.toString()}\"\n\n// Check whether this is a emulator (emulators do not have sessions)\nprintln \"auto.ucs.emulator=${(emu_check.aaaSession.size() == 0) ? 'true' : 'false'}\"\n\n// The firmware version is only returned in the login response\ndef version = loginResponse[1].toString()\nprintln \"auto.ucs.version=${version}\"\n\n// CIMC\nif (system_mode == \"stand-alone\") {\n println \"system.categories=CiscoIMC\"\n // Determine whether this is a blade or rack server\n def cimc_info = lmUcs.getXMLbyClass(url,\"computeRackUnit\", cookie, false, debug)\n def device_type\n if (cimc_info) {\n device_type = \"RackUnit\"\n }\n else {\n cimc_info = lmUcs.getXMLbyClass(url,\"computeBlade\", cookie, false, debug)\n device_type = \"Blade\"\n }\n println \"auto.ucs.cimc.device_type=${device_type}\"\n \n cimc_properties.each { k, v ->\n def value = cimc_info[\"compute\" + device_type][\"@\" + v].toString()\n // Only print values that are not empty/null\n if (value) {\n println \"auto.ucs.cimc.${k}=${value}\"\n }\n }\n}\n// UCS Manager\nelse if (ips.contains(mgmt_info.topSystem.@address.toString())) {\n println \"system.categories=CiscoUCSManager\"\n}\n// Determine which FI we are dealing with\nelse {\n def fi_info = lmUcs.getXMLbyClass(url, \"networkElement\", cookie, true, debug)\n\n fi_info.networkElement.each { fi ->\n if (ips.contains(fi.@oobIfIp.toString())) {\n println \"system.categories=CiscoUCSFabricInterconnect\"\n\n fi_properties.each { k, v ->\n println \"auto.ucs.fi.${k}=${fi[\"@\" + v].toString()}\"\n }\n if (fi.@adminInbandIfState.toString() == \"enable\") {\n println \"auto.ucs.fi.inband_management_ip=${fi.@inbandIfIp}\"\n println \"auto.ucs.fi.inband_management_vnet=${fi.@inbandIfVnet}\"\n }\n }\n }\n}\n\n// Because we are not caching this session, we should logout each time we run it\nlmUcs.logout(url, cookie, debug)\n\nreturn 0"}, "propertySourceType": 0}

×PropertySource: Cisco_Wireless_Info (230)

{"name": "Cisco_Wireless_Info", "appliesTo": "isCisco()", "description": "Capture basic Cisco wireless host system properties.", "group": "Cisco Wireless", "searchKeywords": "wireless,networking,cisco,wlc", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname')\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n/*\nThe following SNMP walkAsMap will handle v1 , v2 and v3.\nProps contains a map of ALL host properties and the SNMP walk method will automatically\nhandle the proper connection based on which SNMP version is configured.\n*/\n\n// define maps we will walk.\ndef entityDesc = Snmp.walkAsMap(host, \"1.3.6.1.2.1.47.1.1.1.1.2\", props, timeout)\n\nentityDesc.each { key, val ->\n\n if (val.toString().contains(\"Wireless LAN Controller\")) {\n\n println \"auto.cisco.wlc.description=${val}\"\n }\n}\n\n// execution was successful, return 0;\nreturn 0"}, "propertySourceType": 0}

×PropertySource: Fortinet_FortiGate_Info (228)

{"name": "Fortinet_FortiGate_Info", "appliesTo": "hasCategory(\"Fortigate\")", "description": "Retrieves firmware version of the FortiGate device.", "group": "Fortinet FortiGate", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname')\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n// Throw into a try/catch\ntry {\n /*\n The following SNMP walkAsMap will handle v1 , v2 and v3. \n Props contains a map of ALL host properties and the SNMP walk method will automatically\n handle the proper connection based on which SNMP version is configured.\n */\n\n // define maps we will walk.\n def firmwareVersion = Snmp.get(host, \".1.3.6.1.4.1.12356.101.4.1.1.0\", props, timeout)\n\n println \"auto.fortinet.fortigate.firmware.version=${firmwareVersion}\"\n\n // execution was successful, return 0;\n return 0\n}\n\ncatch (Exception e) {\n // if exception is caught, print it out and return 1;\n println e\n return 1\n}"}, "propertySourceType": 0}

×PropertySource: addCategory_WindowsFailoverCluster (38)

{"name": "addCategory_WindowsFailoverCluster", "appliesTo": "isWindows()", "description": "Sets appropriate system.categories if the hostname is a Windows Server Failover Cluster. Also sets cluster parameters used for SQL Failover clusters.\n\nIP addresses will work but cause extra work for the collector", "script": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n####################### Data Collection #########################\n# Purpose: Identify Windows Clusters resources\n#------------------------------------------------------------------------------------------------------------\n# Prerequisites:\n# Hostnames in cluster should be the FQDN or the Windows machine name. \n# IP addresses will work but cause extra work for the collector\n#\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n# supresses powershell warnings about cluster versions and deprication\n$WarningPreference = 'SilentlyContinue'\n#------------------------------------------------------------------------------------------------------------\n# Initialize Variables\n# use here-string for declaring variables with special characters '\"$\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$wmi_user = @'\n##WMI.USER##\n'@\n# Using system.sysname to contact cluster. Then will compare hostname IP, Name or FQDN to find out if it's the\n$hostname = \"##SYSTEM.HOSTNAME##\".ToLower()\n$sysName = \"##SYSTEM.SYSNAME##\".ToLower()\n$sysDomain = \"##SYSTEM.DOMAIN##\".ToLower()\n$winRM = '##AUTO.WINRM##'.ToLower()\n$clusterName='##auto.wsfc.name##'\n\n# setting debug flag tp true will cause debug messages to print out to the console.\n$debug = $false\n\n\nif ($DEBUG) {\"--DEBUG-- Hostname: $hostname\"}\nif ($DEBUG) {\"--DEBUG-- PS Version: $( $PSVersionTable.PSVersion )\"}\nif ($DEBUG) {\"--DEBUG-- CollectorName $collectorName \"}\nif ($DEBUG) {\"--DEBUG-- winRM $winRM \"}\nif ($DEBUG) {\"--DEBUG-- ClusterName $clusterName \"}\n\n\n\n# Check that we have a cname and we are using it as the hostname\nif($sysName -ne \"##SYSTEM.SYSNAME##\") {\n if($debug) {Write-Host \"System.SysNameNotSet## Please make sure that the target device belongs to a domain and the 'system.sysname' device property is set\"}\n $sysname = $hostname\n}\n\n# Domain name needs to be added to the system name so it works in all enviroments. I ran into one client that requires FQDN for domain resolution\nif(!($sysName -match $sysDomain)) {\n $sysname = $sysName+\".\"+$sysDomain\n}\n\nif($debug) {$sysName}\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\") {\n if($debug){Write-Host $hostname \"is an IP address\"}\n if ($hostname -eq $sysName){\n if($debug){Write-Host $hostname \" and \"$sysName \"is an IP address\"}\n\n }\n}\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n\n## check to see if this is monitoring the localhost collector, as we will not need to authenticate.\n## the collector really shouldn't be running on a cluster node.\nif ($HOSTNAME -like $COLLECTORNAME)\n{\n if ($DEBUG) { \"--DEBUG-- Hostname is equal Collector name\"}\n $session = New-PSSession -ErrorAction SilentlyContinue\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($WMI_USER) -and [string]::IsNullOrWhiteSpace($WMI_PASS)) -or (($WMI_USER -like '*WMI.USER*') -and ($WMI_PASS -like '*WMI.PASS*') -and $winRM -eq 'enabled' ))\n{\n # no WMI password available. Use service name user and password\n if ($DEBUG) {\"--DEBUG-- Collector user being used.\"}\n $session = New-PSSession -ComputerName $hostname -ErrorAction SilentlyContinue\n if(-not($session))\n { \n $session = New-PSSession -ComputerName $sysName -ErrorAction SilentlyContinue\n }\n \n}\nelseif ($winRM -eq \"enabled\")\n{\n\n if ($DEBUG) { \"--DEBUG-- Remote Creds: Converting user/pass to credential string\"}\n # Use remote powershell with wmi.user and wmi.pass. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $WMI_PASS -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $WMI_USER, $remote_pass;\n $session = New-PSSession -Credential $remote_credential -ComputerName $hostname -ErrorAction SilentlyContinue\n if(-not($session))\n {\n $session = New-PSSession -Credential $remote_credential -ComputerName $sysName -ErrorAction SilentlyContinue\n }\n \n}\nelseif (-not ($session))\n{\n \"Can't create remote powershell session\"\n exit 1\n}\n\nelse\n{\n \"WinRM disabled and not a local collector\"\n exit 1\n}\n\n\n\n\n$scriptBlock = {\n $returnArray = @()\n\n $moduleSuccess = $TRUE\n $clusterName\n try\n {\n $WarningPreference = 'SilentlyContinue'\n Import-Module failoverclusters -ErrorAction SilentlyContinue\n $clusterName = Get-Cluster -ErrorAction SilentlyContinue | Select-Object Name, Domain\n }\n catch\n {\n $moduleSuccess = $FALSE\n }\n\n if ($clusterName -and $moduleSuccess)\n {\n $hostFQDN = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n $clusterFQDN = ($clusterName.name.trim().tolower() + '.' + $clusterName.domain.trim().tolower())\n # $clusterIP = [System.Net.Dns]::GetHostAddresses($clusterFQDN).IPAddressToString\n \n # this should return the ip address of the cluster using the Get-ClusterParameter command. This is more reliable that dns query.\n # If the IP is blank then no IP address has been assigned to the cluster device. \n $clusterIP = Get-ClusterGroup | Where-Object { $_.GroupType -eq \"Cluster\" } | Get-ClusterResource | Where-Object { $_.ResourceType -eq \"IP Address\" } | Get-ClusterParameter -Name \"Address\" | Select-Object -ExpandProperty \"Value\"\n \n \n #This section checks for SQL failover clusters and gets the names of them\n $sqlInstances = get-clusterresource -ErrorAction SilentlyContinue |`\n where-object { $_.ResourceType -like \"SQL Server\" } |`\n get-clusterparameter VirtualServerName, InstanceName | `\n group-object ClusterObject | `\n select-object @{ Name = \"SQLInstance\"; Expression = { [string]::join(\"\\\", ($_.Group | select-object -expandproperty Value)) } }\n\n #put the instance names into a comma seperated string\n $InstanceNames = @()\n foreach ($SQLInstance in $SQLInstances)\n {\n $InstanceNames += $SQLInstance.SQLInstance\n }\n\n # This section will get Listener Names for SQL Server Availability Groups and add them to the instance names\n $AvailabilityGroups = get-clusterresource -ErrorAction SilentlyContinue | where-object { $_.ResourceType -like \"SQL Server Availability Group\" } | select-object name \n foreach ($AvailabilityGroup in $AvailabilityGroups){\n $groupName = $AvailabilityGroup.Name \n # This will get listeners for Virtual Network Name - VNN\n $lsnr = (get-clusterresource -ErrorAction SilentlyContinue | Where-Object {$_.ResourceType -like \"Network Name\" -and $_.Name -match $groupName } |get-ClusterParameter Name).value\n\n # this will check if the availability group is on a Distributed Network Name - DNN\n # DNN use ports instead of IP addresses so must output the port\n if (!$lsnr){$lsnr = (get-clusterresource -ErrorAction SilentlyContinue | Where-Object {$_.ResourceType -like \"Distributed Network Name\" -and $_.OwnerGroup -match $groupName } |get-ClusterParameter Name).value\n $lsnrPort = (get-clusterresource -ErrorAction SilentlyContinue | Where-Object {$_.ResourceType -like \"Distributed Network Name\" -and $_.OwnerGroup -match $groupName } |get-ClusterParameter Name).clusterObject\n $returnArray += \"wsfc.port.$lsnr=$lsnrPort\"\n }\n $InstanceNames += $lsnr\n }\n\n # write the output\n $returnArray += \"wsfc.active_node=$HostFQDN\"\n $returnArray += \"wsfc.name=\"+$clusterName.NAME\n $returnArray += \"wsfc.fqdn=$clusterFQDN\"\n\n if ($clusterIP -gt \"\")\n {\n $returnArray += \"wsfc.ip=$clusterIP\"\n }\n if (($clusterFQDN -eq ($USING:hostname).ToLower()) -or ($clusterIP -eq $USING:hostname) -or ($clusterName.name.trim().tolower() -eq $USING:hostname)) # this $Using statement may fail if a cluster member is also a collector. I don't have a way to test it.\n {\n $clusterNodes = Get-ClusterNode | Select-Object Name\n #put the instance nodes into a comma seperated string\n $nodeNames = @()\n foreach ($node in $clusterNodes)\n {\n $nodeNames += $node.Name\n }\n #send the output for Virtual Network Names\n $returnArray += \"system.categories=WSFC_VNN\"\n $returnArray += \"wsfc.nodes=$nodeNames\"\n # only ouput SQL instances if they exist\n if ($InstanceNames.Length -gt 0){\n $returnArray += \"wsfc.SQLInstanceNames=\" + ($InstanceNames -join \",\")\n }\n\n }\n else\n { # the default is a cluster node. If you made it this far in the code we already know this is a cluster system. If there are SQL instance names then this is an SQL Cluster.\n if ($InstanceNames -ne \"\")\n {\n $returnArray += \"system.categories=WSFC_Node,SQL_Node\"\n }\n else\n {\n $returnArray += \"system.categories=WSFC_Node\"\n }\n }\n return $returnArray\n }\n else{\n $returnArray += \"0\"\n return $returnArray\n }\n}\n\n$response = Invoke-Command -ScriptBlock $scriptBlock -Session $session\n\nif ($response -eq \"0\"){\n # nothing found here. Return 0 since it's not an error\n exit 0\n}\nelse\n{\n\n foreach ($property in $response)\n {\n Write-Host $property\n }\n}\n\n\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\n\nexit 0\n\n"}, "propertySourceType": 0}

×PropertySource: addERI_Cisco_EIGRP (121)

{"name": "addERI_Cisco_EIGRP", "appliesTo": "isCisco()", "description": "Sets Cisco EIGRP peer ERI and Router ERT. \nRequires collector version 30.000 or greater.", "group": "ERI", "searchKeywords": "eigrp,routing,topology,layer 3,cisco", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport org.json.JSONArray\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\nlmtopo = modLoader.load(\"lm.topo\", \"0\")\nlmtopoData = modLoader.load(\"lm.data.topo\", \"0\")\nlmtopoData.run()\n\ndef host = hostProps.get(\"system.hostname\")\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\ndef debug = false\n\ndef ert = \"Router\"\n\ndef l3Eri = []\n\ndef ips = hostProps.get(\"system.ips\")?.tokenize(\",\")\ndef networkAddress = hostProps.get(\"auto.network.address\")\nif (!(ips || networkAddress)) {\n println \"Cannot determine applied to router's IP address\"\n return 1\n}\n\ndef props = hostProps.toProperties()\ndef timeout = 10000\nMap peerAddrMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.9.9.449.1.4.1.1.3\", props, timeout)\npeerAddrMap.each { k, val ->\n\n if (l3Eri.size() != 0) return\n\n def converted_addr // will set once converted\n\n // lets figure out what format our value is in\n if (val =~ /(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)/) { // Ip Address\n converted_addr = val\n } else if (val =~ /[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}/) { // HEX\n // Convert val to base 10 if ip address is in hex format e.g. \"AC:14:00:32\"\n converted_addr = hexToIP(val)\n } else {\n converted_hex = asciiToHex(val)\n converted_ip = hexToIP(converted_hex)\n converted_addr = converted_ip\n }\n\n def eigrpRouterIps\n if (ips) {\n eigrpRouterIps = ips.findAll { converted_addr.contains(it?.tokenize(\".\")[0..1].join(\".\")) }\n eigrpRouterIps.each { eigrpRouterIp ->\n if (lmtopo.isIP(eigrpRouterIp, lmtopoData.blockedKeys, debug)) {\n l3Eri << \"eigrp--${eigrpRouterIp}\"\n }\n }\n }\n if (eigrpRouterIps == null && networkAddress) {\n def eigrpRouterIp = converted_addr.contains(networkAddress.tokenize(\".\")[0..1].join(\".\")) ? networkAddress : null\n if (eigrpRouterIp != null && lmtopo.isIP(eigrpRouterIp, lmtopoData.blockedKeys, debug)) {\n l3Eri << \"eigrp--${eigrpRouterIp}\"\n }\n }\n}\n\ndef eriArray = new JSONArray()\nlmtopo.emitEri(\"net.l3\", 1, l3Eri, ert, eriArray) \nlmtopo.printEriArray(eriArray, keyNamespace, keyBlacklist)\n\nreturn 0\n\ndef hexToIP(input) {\n ArrayList base10IpAddress = []\n\n // Tokenize on \":\", convert to base 10, add to base10IpAddress\n hexInts = input.tokenize(\":\")\n hexInts.each { hexInt ->\n base10IpAddress.add(Integer.parseInt(hexInt, 16))\n }\n\n // Join on \".\" to form base 10 IP address val\n output = base10IpAddress.join(\".\")\n return output\n}\n\ndef asciiToHex(input) {\n ArrayList hex_array = []\n\n // Step-1 - Convert ASCII string to char array\n char[] ch = input.toCharArray()\n for (char c : ch) {\n int i = (int) c;\n // Step-3 Convert integer value to hex using toHexString() method.\n\n hex_array << Integer.toHexString(i).toUpperCase()\n }\n output = hex_array.join(\":\")\n return output\n}"}, "propertySourceType": 1, "collectionInterval": 43200}

×PropertySource: addCategory_Cisco_vManage (94)

{"name": "addCategory_Cisco_vManage", "appliesTo": "vmanage.user && vmanage.pass", "description": "Identifies if the device is a vManage host by attempting login with provided credentials. Sets a system category, version number (if version number available), and flag indicating whether CSRF tokens are required.", "group": "Cisco vManage", "searchKeywords": "sdwan,vmanage,networking,cisco,viptela", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\n// Currently, PropertySources do not share collector script cache with other module types\n// so we will login and logout for this credential check\nsnip.sessionId = snip.login()\nsnip.csrfToken = snip.getCSRFtoken()\n\n// Attempt to get version info; not always available\ndef version = snip.getVersion()\n\nif (snip.testSession()) {\n println \"system.categories=Cisco_vManage\"\n if (version) {\n println \"auto.cisco.vmanage.version=${version}\"\n println \"auto.cisco.vmanage.csrftoken=true\"\n }\n else {\n println \"auto.cisco.vmanage.csrftoken=false\"\n }\n}\nelse {\n\tprintln \"Credential check failed. Verify credentials and try debug mode.\"\n\tsnip.LMDebugLog(\"Credential check failed.\")\n\treturn 1\n}\n// Close session since we cannot reuse this in other modules\nsnip.logout()\n\nreturn 0"}, "propertySourceType": 0}

×PropertySource: addERI_Cisco_vManage (93)

{"name": "addERI_Cisco_vManage", "appliesTo": "hasCategory(\"Cisco_vManage\")", "description": "Sets Cisco HyperFlex host UUID ERI for topology mapping.\nRequires collector version 30.000 or greater.", "group": "ERI", "searchKeywords": "hyperflex,distributed file system,cisco", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport org.json.JSONArray\nimport groovy.json.JsonSlurper\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\ndef lmtopo = modLoader.load(\"lm.topo\", \"0\") // Load LM topo module\n\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\ndef eriType = \"VirtualMachine\"\n\ndef hostEri = []\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\ndef success = false\n\nif (snip.checkCachedCreds()) {\n def devices = snip.getDevice()\n if (devices) {\n devices.'data'.each { it ->\n if (success) return\n def uuid = it.'uuid'?.toString()\n def ip = it.'system-ip'?.toString()\n def connectedVManages = it.'connectedVManages'?.toString()\n if (uuid && ip && connectedVManages && connectedVManages.contains(ip)) {\n hostEri << uuid\n success = true\n }\n }\n }\n}\nelse {\n println \"Credential check failed. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed.\")\n\treturn 1\n}\n\ndef eriArray = new JSONArray()\nlmtopo.emitEri(\"sdwan.cisco\", 1, hostEri, eriType, eriArray)\n\nlmtopo.printEriArray(eriArray, keyNamespace, keyBlacklist)\n\nreturn 0"}, "propertySourceType": 1, "collectionInterval": 1800}

×PropertySource: addERI_Fortinet_FortiGate (116)

{"name": "addERI_Fortinet_FortiGate", "appliesTo": "hasCategory(\"Fortigate\")", "description": "Sets device External Resource IDs (ERIs) for layer 2, layer 3, and HA topology mapping, including LLDP local system name using LLDP-MIB, MAC addresses using RFC1213-MIB, and an SD-WAN and HA id using the FORTINET-FORTIGATE-MIB.\n\nSets ERI Type to Firewall.\nRequires collector version 30.000 or greater.", "group": "ERI", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport org.json.JSONArray\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\nlmtopo = modLoader.load(\"lm.topo\", \"0\")\nlmtopoSnmp = modLoader.load(\"lm.topo.snmp\", \"0\")\nlmtopoData = modLoader.load(\"lm.data.topo\", \"0\")\nlmtopoData.run()\n\ndef host = hostProps.get(\"system.hostname\")\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\ndef debug = false\n\ndef timeout = 300000\n\ndef ert = \"Firewall\"\n\ndef l2Eri = []\ndef haEri = []\ndef l3Eri = []\n\ndef ifTable = lmtopoSnmp.extractInterfaces(host, null, timeout, debug)\nlmtopo.processIntefaceTable(ifTable, lmtopoData.blockedInterfaceNames, lmtopoData.blockedInterfaceTypes, lmtopoData.blockedKeys, l2Eri, debug)\n\n// Handle lldp remote system eri edge case\ndef macEriPrefix = l2Eri[0]?.tokenize(\":\")[0..3].join(\":\")\ndef sysname = hostProps.get(\"system.sysname\")\nif (sysname && macEriPrefix) {\n l2Eri << \"${macEriPrefix}--${sysname.toLowerCase()}\"\n}\n\ndef lldpLocalChassisId = lmtopoSnmp.getLldpLocalChassisId(host, debug)\nlmtopo.processLLDPLocalChassisId(lldpLocalChassisId, lmtopoData.blockedKeys, l2Eri, debug) \n\ndef isActive\ndef props = hostProps.toProperties()\ndef haHostNames = Snmp.walkAsMap(host, \"1.3.6.1.4.1.12356.101.13.2.1.1.11\", null, timeout)?.values()\n\n// 1 is Standalone, 2 is Active-Active, and 3 is Active-Passive HA mode\ndef haMode = Snmp.get(host, \"1.3.6.1.4.1.12356.101.13.1.1.0\")\nif (haMode == \"2\" || haMode == \"3\") {\n def masterSerial = Snmp.walkAsMap(host, \"1.3.6.1.4.1.12356.101.13.2.1.1.16\", null, timeout).find { it.value }?.value\n if (masterSerial) {\n def haHostName = Snmp.get(host, \"1.3.6.1.4.1.12356.101.13.2.1.1.11.1\")\n if (haHostName) {\n haEri << \"${masterSerial.toLowerCase()}--${haHostName.toLowerCase()}\"\n } \n }\n def deviceSerial = Snmp.get(host, \"1.3.6.1.4.1.12356.101.13.2.1.1.2.1\")?.toString()\n if (deviceSerial == masterSerial) isActive = true\n}\n\n// If Standalone or Active\nif (haMode == \"1\" || haMode == \"2\" || haHostNames.size() <= 1 || isActive) {\n def vdomNames = Snmp.walkAsMap(host, \".1.3.6.1.4.1.12356.101.3.2.1.1.2\", props, timeout)\n def vpnTunnelVDOM = Snmp.walkAsMap(host, \".1.3.6.1.4.1.12356.101.12.2.2.1.21\", props, timeout)\n def vpnTunnelEntries = Snmp.walkAsMap(host, \".1.3.6.1.4.1.12356.101.12.2.2.1\", props, timeout)\n vpnTunnelVDOM.each { index, vdomID ->\n def localGatewayIP = vpnTunnelEntries[\"6.${index}\"]\n def localGatewayPort = vpnTunnelEntries[\"7.${index}\"]\n if (lmtopo.isIP(localGatewayIP, lmtopoData.blockedKeys, debug)) {\n l3Eri << \"fortigate--${localGatewayIP}\"\n }\n } \n}\n\ndef eriArray = new JSONArray()\nlmtopo.emitEri(\"net.l2\", 2, l2Eri, ert, eriArray)\nlmtopo.emitEri(\"cluster.fortigate\", 1, haEri, ert, eriArray)\nlmtopo.emitEri(\"net.l3\", 2, l3Eri, ert, eriArray)\nlmtopo.printEriArray(eriArray, keyNamespace, keyBlacklist)\n\nreturn 0"}, "propertySourceType": 1, "collectionInterval": 43200}

×PropertySource: addCategory_Cohesity (216)

{"name": "addCategory_Cohesity", "appliesTo": "exists(\"cohesity.user\") || exists(\"cohesity.api.user\")", "description": "If cohesity.user or cohesity.api.user exists on a resource, the script will check to see if it can log onto the API. If it works, then it adds a system.category of \"Cohesity\" and populates a few auto-properties for the resource including major and minor versions of the API.", "searchKeywords": "cohesity,dataplatform,backup,dataprotect,file system", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \t 2007-2020 - LogicMonitor, Inc. All rights reserved. *\n *******************************************************************************/\nimport groovy.json.*;\n\ndebug = false\n\ndef hostname = hostProps.get('system.hostname');\ndef username = hostProps.get('cohesity.api.user')?:hostProps.get('cohesity.user');\ndef password = hostProps.get('cohesity.api.pass')?:hostProps.get('cohesity.pass');\ndef domain = hostProps.get('cohesity.domain') ?: 'LOCAL';\n\ndef baseURL = 'https://' + hostname + '/irisservices/api/v1'\nLMDebugPrint(\"\"\"Hostname:\t$hostname \nUsername:\t$username \nDomain:\t\t$domain \nBaseURL:\t$baseURL \"\"\", debug)\n\n// Generate authentication token for calls\ndef cohesityToken = getAuthToken(hostname, username, password, domain, baseURL)\nLMDebugPrint(\"\"\"Cohesity authtoken:\t\t$cohesityToken\"\"\",debug)\n// GET data for the endpoint defined:\n// this endpoint gets general cluster information\ndef endPoint = '/public/basicClusterInfo'\nLMDebugPrint(\"endpoint: ${endPoint}\",debug )\ndef allResponse = getURL(baseURL, endPoint, cohesityToken) //This will work even if the token is null\nLMDebugPrint(\"All of the response: ${allResponse}\",debug )\n\ndef clusterEndPoint = '/public/cluster'\nLMDebugPrint(\"endpoint: ${clusterEndPoint}\",debug )\ndef versionResponse = getURL(baseURL, clusterEndPoint, cohesityToken) //This will work even if the token is null\nLMDebugPrint(\"All of the response: ${allResponse}\",debug )\n\n\nif (allResponse)\n{\n\tprintln \"system.categories=cohesity\"\n\tallResponse.each { value ->\n\t\tprintln \"auto.cohesity.${value}\"\n\t}\n\t// on some cohesity clusters the version number isn't found on the public/BasicInfo endpoint.\n\t// the public/cluster endpoint requires valid credentials.\n\tif (allResponse.clusterSoftwareVersion)\n\t{\n\t\tdef version = allResponse.clusterSoftwareVersion.tokenize(\".\")\n\t\tprintln \"auto.cohesity.majorversion=${version[0]}\"\n\t\tprintln \"auto.cohesity.minorversion=${version[1]}\"\n\t}\n\telse if (versionResponse.clusterSoftwareVersion){\n\t\tdef version = versionResponse.clusterSoftwareVersion.tokenize(\".\")\n\t\tprintln \"auto.cohesity.majorversion=${version[0]}\"\n\t\tprintln \"auto.cohesity.minorversion=${version[1]}\"\n\n\t}\n\treturn 0\n}\nelse {\n\tprintln \"Cohesity Server not found\"\n\treturn 1\n}\n//----------------------------------------------------------------------------------------\n// Function to get data from cohesity endpoint\n// if Cohesity Token doesn't exist then the endpoint doesn't need Authentication\ndef getURL(baseURL, endPoint, cohesityToken = null) {\n\tURL url = new URL(baseURL + endPoint)\n\tHttpURLConnection connection = (HttpURLConnection) url.openConnection()\n\tconnection.setRequestMethod(\"GET\")\n\tif (cohesityToken != null) {\n\t\tconnection.addRequestProperty('Authorization', 'Bearer ' + cohesityToken)\n\t\tconnection.addRequestProperty('Content-Type', 'application/json')\n\t\tconnection.addRequestProperty('Accept', 'application/json')\n\t}\n\tconnection.connect()\n\tif (connection.responseCode == 200 || connection.responseCode == 201) {\n\t\treturn new JsonSlurper().parseText(connection.content.text)\n\t}\n\treturn null\n}\n//----------------------------------------------------------------------------------------\n// Method to get Cohesity API authentication token\nString getAuthToken(hostname, username, password, domain, baseURL) {\n\t// set the url.\n\tURL url = new URL(baseURL + '/public/accessTokens')\n\tbyte[] payload = '{\"password\": \"' + password + '\",\"username\": \"' + username + '\",\"domain\":\"' + domain + '\"}'\n\tHttpURLConnection connection = (HttpURLConnection) url.openConnection()\n\tconnection.setRequestMethod(\"POST\")\n\tconnection.addRequestProperty('Content-Type', 'application/json')\n\tconnection.setDoOutput(true)\n\tconnection.getOutputStream().write(payload) //this line writes the body of the POST. Must be in byte[]\n\tconnection.connect()\n\tif (connection.responseCode == 200 || connection.responseCode == 201) {\n\t\treturn new JsonSlurper().parseText(connection.content.text)[\"accessToken\"]\n\t}\n\treturn null\n\n}\n// debug logging function\ndef LMDebugPrint(message, boolean debug = false) {\n\tif (debug) {\n\t\tprintln(message)\n\t}\n}"}, "propertySourceType": 0}

×PropertySource: PaloAlto_Product_Info (214)

{"name": "PaloAlto_Product_Info", "appliesTo": "hasCategory(\"PaloAlto\")", "description": "Retrieves Palo Alto system and chassis metadata such as serial number, chassis type, software version, hardware version, etc.", "group": "Palo Alto", "searchKeywords": "palo alot,security,firewall,networking", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp;\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname')\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\ndef panSysMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.25461.2.1.2.1\", props, timeout)\ndef panChassisType = Snmp.walkAsMap(host, \".1.3.6.1.4.1.25461.2.1.2.2\", props, timeout)\n\n// Chassis\nprintln \"auto.paloalto.chassis.type=\" + panChassisType['1.0']\n\n// System\nprintln \"auto.paloalto.system.software_version=\" + panSysMap['1.0']\nprintln \"auto.paloalto.system.hardware_version=\" + panSysMap['2.0']\nprintln \"auto.paloalto.system.serial_number=\" + panSysMap['3.0']\nprintln \"auto.paloalto.system.vpn_client_version=\" + panSysMap['6.0']\nprintln \"auto.paloalto.system.application_version=\" + panSysMap['7.0']\nprintln \"auto.paloalto.system.antivirus_version=\" + panSysMap['8.0']\nprintln \"auto.paloalto.system.threat_version=\" + panSysMap['9.0']\nprintln \"auto.paloalto.system.url_filtering_version=\" + panSysMap['10.0']\nprintln \"auto.paloalto.system.high_availability.state=\" + panSysMap['11.0']\nprintln \"auto.paloalto.system.high_availability.peer_state=\" + panSysMap['12.0']\nprintln \"auto.paloalto.system.high_availability.mode=\" + panSysMap['13.0']\nprintln \"auto.paloalto.system.url_filtering_database=\" + panSysMap['14.0']\nprintln \"auto.paloalto.system.global_protect_client_version=\" + panSysMap['15.0']\nprintln \"auto.paloalto.system.opswat_database_version=\" + panSysMap['16.0']\nprintln \"auto.paloalto.system.wildfire_version=\" + panSysMap['17.0']\nprintln \"auto.paloalto.system.wildfire_private_cloud_version=\" + panSysMap['18.0']\nprintln \"auto.paloalto.system.application_release_date=\" + panSysMap['20.0']\nprintln \"auto.paloalto.system.threat_release_date=\" + panSysMap['21.0']\nprintln \"auto.paloalto.system.antivirus_release_date=\" + panSysMap['22.0']\nprintln \"auto.paloalto.system.wildfire_release_date=\" + panSysMap['23.0']\n\n\nreturn (0);"}, "propertySourceType": 0}

×PropertySource: addCategory_NetscalersActive (54)

{"name": "addCategory_NetscalersActive", "appliesTo": "hasCategory(\"Netscaler\") && !hasCategory(\"NetscalersActive\")", "description": "Determine if we should activate HA level monitoring for a given device. \n\nShould only emit the NetscalersActive system.category if a device hostname points to a SNIP of an HA pair or a standalone NS.\n\nSee the docs for more details: https://www.logicmonitor.com/support/monitoring/networking-firewalls/citrix-netscalers", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n/*\n Try and detect if a netscaler's hostname is set to it's SNIP.\n This should automate adding the NetscalersActive property as documented here:\n https://www.logicmonitor.com/support/monitoring/networking-firewalls/citrix-netscalers\n\n */\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef props = hostProps.toProperties()\ndef hostname = hostProps.get(\"system.hostname\")\n\n// Handle standalone configuration\ndef haMode = Snmp.get(hostname, \"1.3.6.1.4.1.5951.4.1.1.6.0\")\nif (haMode == \"0\") {\n println \"system.categories=NetscalersActive\"\n return 0\n}\n\n// Handle an HA configuration\ndef deviceAddresses = InetAddress.getAllByName(hostname).collect{ it.getHostAddress() }\ndef snipAddresses = []\n\nSnmp.walkAsMap(hostname, \"1.3.6.1.4.1.5951.4.1.1.26.1.3\", props).each{ ipAddr, ipType ->\n if (ipType == \"4\") {\n snipAddresses << ipAddr\n }\n}\n\n// Fail fast if no SNIP's are configured\nif (snipAddresses.size() == 0) return 0\n\nfor (address in deviceAddresses) {\n if (snipAddresses.contains(address)) {\n println \"system.categories=NetscalersActive\"\n return 0\n }\n}\n\n// Hopefully help the user debug before ditching.\nprint \"${hostname} does not point to a SNIP, consider setting hostname to one of these SNIPs ${snipAddresses}\"\n\nreturn 1"}, "propertySourceType": 0}

×PropertySource: addCategory_SolarisNetSNMP (145)

{"name": "addCategory_SolarisNetSNMP", "appliesTo": "(NetSNMPComputers() && system.sysinfo =~ \"SunOS\") && !hasCategory(\"SolarisNetSNMP\")", "description": "Checks for valid memory data from Net-SNMP on a Solaris resource and sets a category if so.", "searchKeywords": "memory,netsnmp,snmp,solaris", "script": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef snmp_timeout = 15000\ndef props = hostProps.toProperties()\ndef hostname = hostProps.get(\"system.hostname\")\ndef BlockSize = hostProps.get(\"SunOS.BlockSize\")?: 512\n\n\ndef TotalReal = Snmp.get(hostname, \".1.3.6.1.4.1.2021.4.5.0\", props, snmp_timeout).toBigInteger()*BlockSize.toInteger()\n\nif (TotalReal >= 0)\n{\n println \"system.categories=SolarisNetSNMP\"\n}\n\nreturn 0"}, "propertySourceType": 0}

×PropertySource: ConfigCheck_3_Exec (16)

{"name": "ConfigCheck_3_Exec", "appliesTo": "auto.config.port\n// Better Methods\n&& !auto.config.type.sftp\n&& !auto.config.type.scp\n// Overrides\n&& config.type.interactive != \"1\"\n// Don't apply if we plan to enter a mode\n&& !(ssh.enable.pass || ssh.login.pass)\n// Don't apply to Telnet\n&& configsource.use.telnet !~ \"true|1\"", "description": "Sets auto.config.type.exec if collection is possible via SSH Exec.", "group": "Config Checks", "searchKeywords": "configuration,ssh,networking,switch", "script": {"type": "groovy", "content": "// Config EXEC Check\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport net.schmizz.sshj.SSHClient\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport net.schmizz.sshj.connection.channel.direct.Session\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport com.santaba.agent.util.Settings\nimport java.util.concurrent.TimeUnit\nimport java.security.MessageDigest\nimport groovy.json.JsonSlurper\n\ndef version = hostProps.get(\"auto.config.version\", \"-1\")\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef pipe = hostProps.get(\"auto.config.commands.pipe\", \"\")\ndef cmds = hostProps.get(\"config.commands.standard\", hostProps.get(\"auto.config.commands.standard\", \"\")).split(\",\")\n\t\t\t\t\t.plus(hostProps.get(\"config.commands.dynamic\", hostProps.get(\"auto.config.commands.dynamic\", \"\")).split(\",\"))\n\ndef success = false\n\ncmds.grep().each { command->\n\tdef (wild, alias) = command.split('=', 2) \n\t\n\tif(!success) {\n\t\t// Check if we've already had a success with these settings\n\t\tdef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\n\t\tdef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\n\t\tnew File(fileCache.getParent()).mkdirs()\n\t\n\t\tif(fileCache.exists()) {\n\t\t\tdef json = new JsonSlurper().parse(fileCache)\n\t\t\tif(json[\"type\"] == \"EXEC\") {\n\t\t\t\tsuccess = true\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\ndef connectTimeout = 30000 // Timeout attempting a connection.\ndef maximumTimeout = Settings.getSettingInt(\"configcollector.script.timeout\", 120) * 1000 // The maximum time to attempt collection.\n\ndef start = System.currentTimeMillis()\n\ncmds.grep().each { command->\n\tdef (wild, alias) = command.split('=', 2)\n\n\tif(!success && System.currentTimeMillis() - start < maximumTimeout) {\n\t\tdef client = new SSHClient()\n\t\tclient.setTimeout(maximumTimeout)\n\t\tclient.setConnectTimeout(connectTimeout)\n\t\tclient.addHostKeyVerifier(new PromiscuousVerifier())\n\n\t\ttry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\n\t\tdef session\n\n\t\ttry {\n\t\t\tclient.connect(host, port.toInteger())\n\n\t\t\tif(pKey && new File(pKey).exists()) {\n\t\t\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t\t\t} else {\n\t\t\t\tclient.auth(user,\n\t\t\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\t\t\tnew AuthNone())\n\t\t\t}\n\t\t\t\n\t\t\tsession = client.startSession()\n\t\t\tsession.allocateDefaultPTY()\n\n\t\t\tdef cmd = session.exec(wild + pipe)\n\t\t\tcmd.join(maximumTimeout, TimeUnit.MILLISECONDS)\n\t\t\tcmd.close()\n\t\t\n\t\t\tdef out = cmd.getInputStream().text.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\tout = \"\"\n\t\t\t}\n\n\t\t\tif(out) {\n\t\t\t\tsuccess = true\n\t\t\t}\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tif(!ex.message || ex.message.contains(\"Connection refused\")) { \n\t\t\t\t// This is usually something that won't improve in later attempts.\n\t\t\t\tthrow ex\n\t\t\t} else {\n\t\t\t\tprintln \"Exception: ${ex.message}\"\n\t\t\t}\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tsession?.close()\n\t\t\t\tclient?.disconnect()\n\t\t\t} catch(Exception ex) {\n\t\t\t\tprintln \"Exception: ${ex.message}\"\n\t\t\t}\n\t\t}\n\t}\n}\n\nif(success) {\n\tprintln(\"config.type.exec=1\")\n}\n\nreturn 0"}, "propertySourceType": 0}

×PropertySource: addCategory_SAP_HANA (127)

{"name": "addCategory_SAP_HANA", "appliesTo": "hana.user", "description": "For Local instances of SAP HANA, will add category \"HANA\" and for cloud instances will add \"HANA_Cloud\".", "searchKeywords": "database,erp,sap,hana,version", "technicalNotes": "Requires Collector 30.000 or greater.", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.live.LiveHostSet\n\nString hostName = hostProps.get(\"system.hostname\")?: \"\"\nString categories = hostProps.get(\"system.categories\")\nString username = hostProps.get(\"hana.user\") ?:\"\"\nString password = hostProps.get(\"hana.pass\") ?:\"\"\nString ports = hostProps.get(\"hana.port\")?:\"39013\" //default systemDB port\nString listeningPorts = hostProps.get(\"auto.network.listening_tcp_ports\")?:\"\"\ndef debug = false\n\n// Collector version 30.000 or higher required for snippets\ndef modLoader\ntry\n{\n\tmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored)\n{\n\tprintln \"Update collector to version 30.000 or higher for this DataSource.\"\n\treturn 1\n}\ndef emit = modLoader.load(\"lm.emit\",\"0\")\ndef lmSql = modLoader.load(\"lm.sql\",\"0\")\ndef lmDiag = modLoader.load(\"lm.diag\",\"0\")\n\nif (password==\"\")\n{\n\tprintln \"No password set in hana.pass device property.\"\n\treturn 1\n}\n\ndef allports = ports.split(\",\")\ndef minPort = (allports[0]?:ports).trim()\ndef databaseNames = []\nString buildBranch =\"\"\n\nallports.each() {\n\tportString ->\n\t\tportString = portString.trim()\n\t\tlmDiag.LMDebugPrint(\"${portString} status is ${probeTcpPort(hostName, portString.toInteger())} \",debug)\n\t\tif (listeningPorts =~ portString || probeTcpPort(hostName, portString.toInteger()))\n\t\t{\n\t\t\tString url = \"jdbc:sap://\" + hostName + \":\" + portString\n\t\t\tdef conn = lmSql.attemptConnection(username, password, url)\n\t\t\tif (conn.status == \"success\")\n\t\t\t{\n\t\t\t\t//get version of hana DB\n\t\t\t\tString nameQuery = 'select VERSION, DATABASE_NAME as NAME from SYS.M_DATABASE;'\n\t\t\t\tdef nameData = lmSql.runQuery(nameQuery, conn.connection)\n\n\t\t\t\tif (nameData.status == \"success\")\n\t\t\t\t{\n\t\t\t\t\tdatabaseNames.add([portString,(nameData.data[0].NAME).replaceAll(/[:|\\\\|\\s|=]+/, \"_\"), nameData.data[0].VERSION])\n\t\t\t\t}\n\t\t\t\t//Retrieve the rest of the HANA properties. To add new props add them to the query\n\t\t\t\t// do this only for the first port in the list\n\t\t\t\tif (portString==minPort)\n\t\t\t\t{\n\t\t\t\t\tString propsQuery = \"\"\"SELECT HOST, KEY, VALUE FROM M_HOST_INFORMATION\n\t\t\t\t\t\t\tWHERE KEY IN ('cpu_sockets','cpu_cores','cpu_threads', 'cpu_summary','os_name', 'sapsystem', 'net_publicname' ,'timezone_name' ,'cpu_model', 'build_branch','os_kernel_version', 'platform')\"\"\"\n\t\t\t\t\tdef propsData = lmSql.runQuery(propsQuery, conn.connection)\n\t\t\t\t\tif (propsData.status == \"success\")\n\t\t\t\t\t{\n\t\t\t\t\t\tpropsData.data.each\n\t\t\t\t\t\t{ rows ->\n\t\t\t\t\t\t\tif (rows.key == 'build_branch')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbuildBranch = rows.value\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tprintln \"hana.${rows.key} = ${rows.value}\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconn.connection.close()\n\t\t\t}\n\n\t\t}\n}\ndef dbnames=[]\ndatabaseNames.each { port, name, version ->\n\tdbnames.add(\"${name.trim().toLowerCase()}\")\n\tprintln \"hana.${name}.version=${version}\"\n\tprintln \"hana.${name}.url=jdbc:sap://${hostName.trim()}:${port}\"\n}\n\n\nprintln \"hana.dbnames=${dbnames.join(\",\")}\"\n\nif (buildBranch.contains('fa/CE'))\n{\n\tprintln 'system.categories=HANACloud'\n\n\t// Update the liveHost set so tell the collector we are happy.\n\thostId = hostProps.get(\"system.deviceId\").toInteger()\n\tliveHostSet = LiveHostSet.getInstance()\n\tliveHostSet.flag(hostId)\n}\nelse\n{\n\tprintln 'system.categories=HANA' //defaults to HANA\n}\n\nreturn 0\n\nstatic boolean probeTcpPort(String host, int port) {\n\tSocket socket = null;\n\ttry {\n\t\tsocket = new Socket();\n\t\tsocket.connect(new InetSocketAddress(host, port.toInteger()), 5000);\n\t\treturn true;\n\t} catch (IOException ignored) {\n\n\t} finally {\n\t\tsocket.close()\n\t}\n\treturn false;\n}"}, "propertySourceType": 0}

×PropertySource: addCategory_Cisco_Multicast (64)

{"name": "addCategory_Cisco_Multicast", "appliesTo": "isCisco() && !hasCategory(\"CiscoMulticast\")", "description": "Adds category \"CiscoMulticast\" to devices that respond to the CISCO-IGMP-SNOOPING-MIB.\nRequires collector version 30.000 or greater.", "group": "Cisco", "searchKeywords": "cisco,multicast", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get(\"system.hostname\")\ndef oid = \"1.3.6.1.4.1.9.9.263.1.7.3\" // cisMulticastGroupPortList\ndef timeout = 160000\ndef props = hostProps.toProperties()\ndef cisMulticastGroupPortList = Snmp.walkAsMap(host, oid, props, timeout)\n\nif (cisMulticastGroupPortList) {\n println \"system.categories=CiscoMulticast\"\n}\n\nreturn 0"}, "propertySourceType": 0}

×PropertySource: addCategory_PowerMax (86)

{"name": "addCategory_PowerMax", "appliesTo": "emc.unisphere.user", "description": "Collects the current PowerMax version and adds to system.categories.", "searchKeywords": "unisphere,powermax,emc", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\ndef debug = false\n\ndef modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\ndef lmPowerMax = modLoader.load(\"emc.powermax\", \"0.1\") // Load EMC PowerMax module\n\ndef snip = lmPowerMax.powerMaxSnippetFactory(out, hostProps, debug)\n\n// Verify API is accessible and retrieve version number\ndef verEndpoint = \"/system/version\"\ndef verRequest = snip.httpGET(verEndpoint)\ndef version = snip.slurpResponse(verRequest)?.version\n\nif (version) {\n\tlmEmit.property(\"system.categories\", \"PowerMax\")\n\tlmEmit.property(\"system.categories\", \"Unisphere${version}\") // Allow for dynamic value due to necessity of V9+\n\tlmEmit.property(\"auto.unisphere.version\", version)\n}\ndef sysEndpoint = \"/system/symmetrix\"\ndef idRequest = snip.httpGET(sysEndpoint)\ndef idResults = snip.slurpResponse(idRequest)\ndef idJson = idResults?.symmetrixId\n\nif (idJson) {\n def syslogEndpoint = \"${sysEndpoint}/${idJson.first()}\"\n def syslogResponse = snip.httpGET(syslogEndpoint)\n def syslogJson = snip.slurpResponse(syslogResponse)\n\n if (syslogJson.symmetrix) {\n syslogJson.symmetrix.each{ it ->\n def model = it.model\n lmEmit.property(\"auto.${model.replaceAll(/_\\d*/,\"\").toLowerCase()}.model\", \"${model.replaceAll(\"_\", \" \")}\")\n }\n }\n}\nelse {\n snip.LMDebugPrint(idResults?.message)\n}\n\nreturn 0"}, "propertySourceType": 0}

×PropertySource: addCategory_SilverPeak_Appliance (97)

{"name": "addCategory_SilverPeak_Appliance", "appliesTo": "silverpeak.orchestrator.host && ((silverpeak.orchestrator.user && silverpeak.orchestrator.pass) || (silverpeak.user && silverpeak.pass))", "description": "Sets SilverPeakAppliance system category if silverpeak.orchestrator.host, silverpeak.orchestrator.user, and silverpeak.orchestrator.pass properties are set and can authenticate to the VXOA REST API 8.3 and the device sysname matches an Orchestrator appliance hostname\n\nSet silverpeak.orchestrator.logintype to a following integer if an alternative login type is desired:\n\nLocal(0), RADIUS(1), TACACS+(2), OAuth(3), JWT(4), SAML(5). Default is Local(0)", "searchKeywords": "sdwan,appliance,silverpeak", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport groovy.json.JsonOutput\n\ndebug = false\n\nhost = hostProps.get(\"silverpeak.orchestrator.host\")\nuser = hostProps.get(\"silverpeak.orchestrator.user\") ?: hostProps.get(\"silverpeak.user\")\npass = hostProps.get(\"silverpeak.orchestrator.pass\") ?: hostProps.get(\"silverpeak.pass\")\n\nloginType = hostProps.get(\"silverpeak.orchestrator.logintype\") ?: \"0\"\n\nstatsInterval = 240 // Default go back every 2 minutes until successful stats retrieval\nstatsFailureThreshold = 75 // Only go back 75 intervals or 5 hours by default\n\ndef sysname = hostProps.get(\"system.sysname\")\ndef appliances = httpGet(\"/appliance\")\nappliances.each { appliance -> \n def applianceId = appliance.id\n def applianceHostname = appliance.hostName \n if (applianceHostname.toLowerCase() == sysname.toLowerCase()) {\n println \"auto.silverpeak.appliance=${applianceHostname}\"\n println \"auto.silverpeak.applianceid=${applianceId}\"\n println \"system.categories=SilverPeakAppliance\"\n long currentEpochTime = new Date().getTime() / 1000\n def tunnelData = []\n def attempts = 1\n while (tunnelData.isEmpty() && attempts < statsFailureThreshold) {\n long startTime = currentEpochTime - statsInterval * attempts\n tunnelData = httpGet(\"/stats/aggregate/tunnel/${applianceId}?granularity=minute&startTime=${startTime}&endTime=${currentEpochTime}\")\n if (debug) println \"Attempt ${attempts} to get /stats/aggregate/tunnel/${applianceId} data. Went back ${statsInterval * attempts / 60} minutes\"\n if (!tunnelData.isEmpty()) {\n statsInterval = currentEpochTime - startTime\n println \"silverpeak.orchestrator.statsInterval=${statsInterval}\"\n } \n attempts++ \n } \n }\n}\n\nreturn 0\n\ndef httpGet(url) {\n def getUrl = \"https://${host}/gms/rest${url}\"\n def slurper = new JsonSlurper()\n def data = null\n try { \n // Try GET using default CookieManager\n data = slurper.parseText(new URL(getUrl).text)\n } catch (IOException exception) {\n if (debug) println \"Exception occurred fetching data with default CookieManager: ${exception}\"\n\n // Login\n def httpClient = \"https://${host}/gms/rest/authentication/login\".toURL().openConnection()\n def loginHeaders = [\"Content-Type\": \"application/json\"]\n loginHeaders.each { k, v -> httpClient.setRequestProperty(k, v) }\n httpClient.setRequestMethod(\"POST\")\n httpClient.setDoOutput(true)\n OutputStream os = httpClient.getOutputStream()\n byte[] input = JsonOutput.toJson([\"user\": user, \"password\": pass, \"token\": \"\", \"loginType\": loginType]).getBytes(\"utf-8\");\n os.write(input, 0, input.length);\n def responseCode = httpClient.getResponseCode()\n if (responseCode != 200){\n throw new Exception(\"Module tried to login and failed: ERROR CODE ${httpClient.getResponseCode()}\")\n }\n \n data = slurper.parseText(new URL(getUrl).text)\n }\n return data\n}"}, "propertySourceType": 0}

×PropertySource: addCategory_SilverPeak_Orchestrator (96)

{"name": "addCategory_SilverPeak_Orchestrator", "appliesTo": "silverpeak.orchestrator.user && silverpeak.orchestrator.pass", "description": "Sets SilverPeakOrchestrator system category if silverpeak.orchestrator.user and silverpeak.orchestrator.pass properties are set and can authenticate to the VXOA REST API 8.3\n\nSet silverpeak.orchestrator.logintype to a following integer if an alternative login type is desired:\n\nLocal(0), RADIUS(1), TACACS+(2), OAuth(3), JWT(4), SAML(5). Default is Local(0)", "searchKeywords": "sdwan,orchestrator,silverpeak", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport groovy.json.JsonOutput\n\ndebug = false\n\nhost = hostProps.get(\"silverpeak.orchestrator.host\") ?: hostProps.get(\"system.hostname\")\nuser = hostProps.get(\"silverpeak.orchestrator.user\") ?: hostProps.get(\"silverpeak.user\")\npass = hostProps.get(\"silverpeak.orchestrator.pass\") ?: hostProps.get(\"silverpeak.pass\")\n\nloginType = hostProps.get(\"silverpeak.orchestrator.logintype\") ?: \"0\"\n\nstatsInterval = 240 // Default go back every 2 minutes until successful stats retrieval\nstatsFailureThreshold = 75 // Only go back 75 intervals or 5 hours by default\n\ndef appliances = httpGet(\"/appliance\")\nif (appliances?.size() > 0) {\n println \"system.categories=SilverPeakOrchestrator\"\n def applianceId = appliances[0].id\n long currentEpochTime = new Date().getTime() / 1000\n def tunnelData = []\n def attempts = 1\n while (tunnelData.isEmpty() && attempts < statsFailureThreshold) {\n long startTime = currentEpochTime - statsInterval * attempts\n tunnelData = httpGet(\"/stats/aggregate/tunnel/${applianceId}?granularity=minute&startTime=${startTime}&endTime=${currentEpochTime}\")\n if (debug) println \"Attempt ${attempts} to get /stats/aggregate/tunnel/${applianceId} data. Went back ${statsInterval * attempts / 60} minutes\"\n if (!tunnelData.isEmpty()) {\n statsInterval = currentEpochTime - startTime\n println \"silverpeak.orchestrator.statsInterval=${statsInterval}\"\n } \n attempts++ \n } \n}\n\nreturn 0\n\ndef httpGet(url) {\n def getUrl = \"https://${host}/gms/rest${url}\"\n def slurper = new JsonSlurper()\n def data = null\n try { \n // Try GET using default CookieManager\n data = slurper.parseText(new URL(getUrl).text)\n if (debug) println \"Fetched data using default CookieManager: ${CookieManager.getDefault().getCookieStore().getCookies()}\"\n } catch (IOException exception) {\n if (debug) println \"Exception occurred fetching data with default CookieManager: ${exception}\"\n\n // If no default CookieManager, then instantiate and set as new default\n def cookieManager = CookieManager.getDefault()\n if (!cookieManager) {\n cookieManager = new CookieManager()\n cookieManager.setDefault(cookieManager)\n if (debug) println \"Instantiated and set new default CookieManager: ${cookieManager}\"\n }\n\n // Login\n def httpClient = \"https://${host}/gms/rest/authentication/login\".toURL().openConnection()\n def loginHeaders = [\"Content-Type\": \"application/json\"]\n loginHeaders.each { k, v -> httpClient.setRequestProperty(k, v) }\n httpClient.setRequestMethod(\"POST\")\n httpClient.setDoOutput(true)\n OutputStream os = httpClient.getOutputStream()\n byte[] input = JsonOutput.toJson([\"user\": user, \"password\": pass, \"token\": \"\", \"loginType\": loginType]).getBytes(\"utf-8\");\n os.write(input, 0, input.length);\n def responseCode = httpClient.getResponseCode()\n if (responseCode != 200){\n throw new Exception(\"Module tried to login and failed: ERROR CODE ${httpClient.getResponseCode()}\")\n }\n if (debug) println \"Module logged in. Cookie stored in CookieManager: ${CookieManager.getDefault().getCookieStore().getCookies()}\"\n \n data = slurper.parseText(new URL(getUrl).text)\n if (debug) println \"Fetched data using default CookieManager: ${CookieManager.getDefault().getCookieStore().getCookies()}\"\n }\n return data\n}"}, "propertySourceType": 0}

×PropertySource: addCategory_KubernetesKSM (34)

{"name": "addCategory_KubernetesKSM", "appliesTo": "system.devicetype == \"8\"", "description": "Adds the property \"KubernetesKSM\" for Kubernetes clusters that have kube-state-metrics installed. Applies to the API Server device.", "searchKeywords": "kube-state-metrics,kubernetes,ksm,k8s", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\n\ndef k8s_info = getKubernetesProperties(hostProps)\n\nString useSSL = k8s_info.get(\"k8s_service_ssl\", true)\n\n// Find the KSM service\ndef ksmServiceName = getKsmService(useSSL, k8s_info)\n\nif (ksmServiceName.ksmService) {\n String ksmUrl = \"http://${ksmServiceName.ksmService}.${ksmServiceName.ksmServiceNamespace}.svc.cluster.local:${ksmServiceName.ksmPort}/metrics\"\n println \"system.categories=KubernetesKSM\"\n println \"auto.ksm.service.url=${ksmUrl}\"\n}\n\nreturn 0\n\nstatic Map getKsmService(String useSSL, Map k8s_info) {\n\n String servicesUrl\n if (useSSL) {\n servicesUrl = \"https://${k8s_info.k8s_service_host}:${k8s_info.k8s_service_port}/api/v1/services\"\n } else {\n servicesUrl = \"http://${k8s_info.k8s_service_host}:${k8s_info.k8s_service_port}/api/v1/services\"\n }\n def services = new JsonSlurper().parseText(httpGet(servicesUrl, k8s_info))\n // def ksmService = services.items.metadata.name.find { it =~ \"argus-kube-state-metrics\" }\n\n // Check first if Kube State Metrics is configured via Argus and return service name.\n def ksmService = null\n def ksmServiceNamespace = null\n def ksmPort = null\n\n services.items.each { s ->\n if (s.metadata.name.contains(\"argus-kube-state-metrics\")) {\n ksmService = s.name\n ksmServiceNamespace = s.namespace\n s.spec.ports.each { t ->\n if (t.name == \"http\")\n ksmPort = t.port\n }\n }\n }\n\n // If Kube State Metrics Service is not configured via Argus\n if (ksmService == null) {\n // Search for any existing Kube State Metrics Service\n services.items.each { s ->\n if (s.metadata.labels != null && s.metadata.labels.containsValue(\"kube-state-metrics\")) {\n ksmService = s.metadata.name\n ksmServiceNamespace = s.metadata.namespace\n s.spec.ports.each { t ->\n if (t.name == \"http\")\n ksmPort = t.port\n }\n }\n }\n }\n\n return [\n ksmService : ksmService,\n ksmServiceNamespace: ksmServiceNamespace,\n ksmPort : ksmPort]\n}\n\n// KSM specific http get function.\nstatic String httpGet(String endpoint, Map k8s_info) {\n def headers = [\n \"Authorization\": \"Bearer ${k8s_info.k8s_serviceaccount_token}\"\n ]\n\n def request = endpoint.toURL().openConnection()\n\n headers.each { request.addRequestProperty(it.key, it.value) }\n def responseCode = request.getResponseCode()\n\n if (responseCode == 200) {\n return request.content.text\n } else {\n throw new Exception(\"Unexpected http response code ${responseCode} from GET to ${endpoint}\")\n }\n}\n\ndef getKubernetesProperties(parent_hostProps) {\n def k8s_namespace = parent_hostProps?.get(\"auto.namespace\")\n def k8s_name = parent_hostProps?.get(\"auto.name\")\n def k8s_nodename = parent_hostProps?.get(\"auto.nodename\")\n def k8s_pod = parent_hostProps?.get(\"auto.pod\")\n def k8s_selflink = parent_hostProps?.get(\"auto.selflink\")\n def k8s_ssl = parent_hostProps?.get(\"auto.kubernetes.label.ssl\") ? parent_hostProps?.get(\"auto.kubernetes.label.ssl\") : true\n\n def env = System.getenv()\n def k8s_service_host = env[\"KUBERNETES_SERVICE_HOST\"]\n def k8s_service_port = env.get(\"KUBERNETES_SERVICE_PORT\")?.toInteger() ?: 443\n\n def k8s_service_ssl = (k8s_service_port == 443)\n if (k8s_ssl) {\n k8s_service_ssl = k8s_ssl\n }\n\n def k8s_serviceaccount_token = new File('/var/run/secrets/kubernetes.io/serviceaccount/token').text\n def request_headers = [\"Authorization\": \"Bearer ${k8s_serviceaccount_token}\"]\n\n return [\n k8s_namespace : k8s_namespace,\n k8s_name : k8s_name,\n k8s_nodename : k8s_nodename,\n k8s_pod : k8s_pod,\n k8s_serviceaccount_token: k8s_serviceaccount_token,\n k8s_selflink : k8s_selflink,\n k8s_service_host : k8s_service_host,\n k8s_service_port : k8s_service_port,\n k8s_service_ssl : k8s_service_ssl\n ]\n}"}, "propertySourceType": 0}

×PropertySource: addCategory_CitrixMonitorServiceV4 (75)

{"name": "addCategory_CitrixMonitorServiceV4", "appliesTo": "isWindows() && !hasCategory(\"CitrixMonitorServiceV4\")", "description": "Checks for the Citrix Monitor Services and sets appropriate system categories.", "group": "Citrix", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.groovyapi.win32.WMI\nimport groovy.json.JsonSlurper\nimport org.apache.http.auth.AuthScope\nimport org.apache.http.auth.NTCredentials\nimport org.apache.http.client.methods.HttpGet\nimport org.apache.http.impl.client.BasicCredentialsProvider\nimport org.apache.http.impl.client.HttpClientBuilder\n\ndef username = hostProps.get(\"citrix.vad.user\") ?: hostProps.get(\"xenapp.user\")\ndef password = hostProps.get(\"citrix.vad.user\") ?: hostProps.get(\"xenapp.pass\")\n\n\nif (username && password) {\n\n try {\n def hostname = hostProps.get('system.hostname');\n def wmiQuery = \"Select name,state from Win32_Service Where Name ='CitrixMonitor'\";\n def session = WMI.open(hostname);\n def result = session.queryFirst(\"CIMv2\", wmiQuery, 10);\n\n if (result.STATE == \"Running\" && username.contains(\"\\\\\")) {\n\n def domain = username.tokenize('\\\\')[0]\n username = username.tokenize('\\\\')[1]\n\n def filterCitrixMonitorServiceV4 = '?()'\n\n def queryCitrixMonitorServiceV4 = \"/Citrix/Monitor/OData/v4/Data/\" + filterCitrixMonitorServiceV4\n\n def CitrixMonitorServiceV4 = getCitrixPropertyData(hostname, username, password, queryCitrixMonitorServiceV4, domain)\n\n if (CitrixMonitorServiceV4 != null) {\n println 'system.categories=CitrixMonitorServiceV4'\n\n }\n\n }\n }\n catch (IOException) {\n return 0\n }\n\n}\n\nreturn 0\n\n// Helper method which handles fetching Citrix API data\ndef getCitrixPropertyData(String hostname, String username, String password, String query, String domain) {\n\n def odataCleanQuery = '&$format=application/json;odata.metadata=none'\n\n def enableHTTPS = hostProps.get(\"Citrix.VAD.HTTPS\") ?: null\n //optional, set to true for https mode, defaults to http connection\n def enableSecureHostname = hostProps.get(\"Citrix.VAD.SecureHostname\") ?: hostname\n //optional, set property to the hostname used in the certificate for https mode, defaults to hostname\n\n def uri = \"http://\" + hostname + query + odataCleanQuery\n if (enableHTTPS) {\n uri = \"https://\" + enableSecureHostname + query + odataCleanQuery\n }\n\n def credentials = new NTCredentials(\"${username}\", \"${password}\", \"${hostname}\", \"${domain}\")\n def credentialProvider = new BasicCredentialsProvider()\n credentialProvider.setCredentials(AuthScope.ANY, credentials)\n\n def client = HttpClientBuilder.create().setDefaultCredentialsProvider(credentialProvider).build()\n\n def httpResponse = client.execute(new HttpGet(uri))\n\n if (httpResponse.getStatusLine().getStatusCode() != 200) {\n throw new Exception(httpResponse.getStatusLine().toString())\n }\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()))\n\n String inputLine\n StringBuffer response = new StringBuffer()\n\n while ((inputLine = reader.readLine()) != null) {\n response.append(inputLine)\n }\n\n reader.close()\n client.close()\n\n def raw_data = response.toString()\n\n def clean_data = new JsonSlurper().parseText(raw_data)\n\n return clean_data\n}"}, "propertySourceType": 0}

×PropertySource: selfMonitor_KubernetesKSM (33)

{"name": "selfMonitor_KubernetesKSM", "appliesTo": "system.devicetype == \"8\" && hasCategory(\"KubernetesKSM\") && hasCategory(\"KubernetesService\") && getPropValue(\"kubernetes.label.app.kubernetes.io/name\") == \"kube-state-metrics\"", "description": "Creates the kube-state-metrics self monitor url dynamically and adds as a property. Applies to the kube-state-metrics service", "searchKeywords": "kube-state-metrics,kubernetes,ksm,k8s", "script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\n\ndef k8s_info = getKubernetesProperties(hostProps)\nString useSSL = k8s_info.get(\"k8s_service_ssl\", true)\n\n// Find the KSM service\n//def services = new JsonSlurper().parseText(getKsmService(useSSL, k8s_info))\ndef ksmSelfMonitorDetails = getKsmService(useSSL, k8s_info)\n\nString ksmSelfMonitorUrl = \"http://${ksmSelfMonitorDetails.ksmService}.${ksmSelfMonitorDetails.ksmServiceNamespace}.svc.cluster.local:${ksmSelfMonitorDetails.ksmPort}/metrics\"\n\nprintln \"auto.ksm.selfmonitor.url=${ksmSelfMonitorUrl}\"\nreturn 0\n\n\nstatic Map getKsmService(String useSSL, Map k8s_info) {\n\n String servicesUrl\n if (useSSL) {\n servicesUrl = \"https://${k8s_info.k8s_service_host}:${k8s_info.k8s_service_port}/api/v1/services\"\n } else {\n servicesUrl = \"http://${k8s_info.k8s_service_host}:${k8s_info.k8s_service_port}/api/v1/services\"\n }\n def services = new JsonSlurper().parseText(httpGet(servicesUrl, k8s_info))\n // def ksmService = services.items.metadata.name.find { it =~ \"argus-kube-state-metrics\" }\n\n // Check first if Kube State Metrics is configured via Argus and return service name.\n def ksmService = null\n def ksmServiceNamespace = null\n def ksmPort = null\n\n services.items.each { s ->\n if (s.metadata.name.contains(\"argus-kube-state-metrics\")) {\n ksmService = s.name\n ksmServiceNamespace = s.namespace\n s.spec.ports.each { t ->\n if (t.name == \"metrics\")\n ksmPort = t.port\n }\n }\n }\n\n // If Kube State Metrics Service is not configured via Argus\n if (ksmService == null) {\n // Search for any existing Kube State Metrics Service\n services.items.each { s ->\n if (s.metadata.labels != null && s.metadata.labels.containsValue(\"kube-state-metrics\")) {\n ksmService = s.metadata.name\n ksmServiceNamespace = s.metadata.namespace\n s.spec.ports.each { t ->\n if (t.name == \"metrics\")\n ksmPort = t.port\n }\n }\n }\n }\n\n return [\n ksmService : ksmService,\n ksmServiceNamespace: ksmServiceNamespace,\n ksmPort : ksmPort]\n}\n\n// KSM specific http get function.\nstatic String httpGet(String endpoint, Map k8s_info) {\n def headers = [\n \"Authorization\": \"Bearer ${k8s_info.k8s_serviceaccount_token}\"\n ]\n\n def request = endpoint.toURL().openConnection()\n\n headers.each { request.addRequestProperty(it.key, it.value) }\n def responseCode = request.getResponseCode()\n\n if (responseCode == 200) {\n return request.content.text\n } else {\n throw new Exception(\"Unexpected http response code ${responseCode} from GET to ${endpoint}\")\n }\n}\n\ndef getKubernetesProperties(parent_hostProps) {\n def k8s_namespace = parent_hostProps?.get(\"auto.namespace\")\n def k8s_name = parent_hostProps?.get(\"auto.name\")\n def k8s_nodename = parent_hostProps?.get(\"auto.nodename\")\n def k8s_pod = parent_hostProps?.get(\"auto.pod\")\n def k8s_selflink = parent_hostProps?.get(\"auto.selflink\")\n def k8s_ssl = parent_hostProps?.get(\"auto.kubernetes.label.ssl\") ? parent_hostProps?.get(\"auto.kubernetes.label.ssl\") : true\n\n def env = System.getenv()\n def k8s_service_host = env[\"KUBERNETES_SERVICE_HOST\"]\n def k8s_service_port = env.get(\"KUBERNETES_SERVICE_PORT\")?.toInteger() ?: 443\n\n def k8s_service_ssl = (k8s_service_port == 443)\n if (k8s_ssl) {\n k8s_service_ssl = k8s_ssl\n }\n\n def k8s_serviceaccount_token = new File('/var/run/secrets/kubernetes.io/serviceaccount/token').text\n def request_headers = [\"Authorization\": \"Bearer ${k8s_serviceaccount_token}\"]\n\n return [\n k8s_namespace : k8s_namespace,\n k8s_name : k8s_name,\n k8s_nodename : k8s_nodename,\n k8s_pod : k8s_pod,\n k8s_serviceaccount_token: k8s_serviceaccount_token,\n k8s_selflink : k8s_selflink,\n k8s_service_host : k8s_service_host,\n k8s_service_port : k8s_service_port,\n k8s_service_ssl : k8s_service_ssl\n ]\n}"}, "propertySourceType": 0}

×EventSource: PaloAlto_FW_ThreatAnalysis_Events (15)

{"name": "PaloAlto_FW_ThreatAnalysis_Events", "appliesTo": "hasCategory(\"PaloAlto\")", "description": "Presents recognized threats of either \"critical\" or \"high\" severity as warning-level device events", "searchKeywords": "firewall,paloalto,network", "technicalNotes": "requires API key stored in paloalto.apikey.pass.\nIf the Palo Alto device is not set to save logs in UTC format, a paloalto.timezone host property should be provided (i.e -7 for PDT).", "severity": "warn", "collectionMethod": "scriptevent", "clearAfterMin": 5, "clearAfterAck": true, "doMapping": true, "collectionAttrs": [{"script": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.http.*;\nimport groovy.time.TimeCategory;\nimport groovy.json.JsonBuilder;\n\ndef host = hostProps.get(\"system.hostname\")\ndef apikey = hostProps.get(\"paloalto.apikey.pass\")\ndef timezoneOffset = (hostProps.get(\"paloalto.timezone\") ?: 0).toInteger()\n\ndef duration = \"1800\".toInteger()\n\n// get the datetime as of the estimated last collection\nuse(TimeCategory)\n{\n lastCollection = new Date() + timezoneOffset.hours - duration.seconds\n}\n\n// assemble the paloalto threat log query and retrieve job id from output\ndef threatQuery = \"receive_time geq '\" + lastCollection.format(\"yyyy/MM/dd HH:mm:ss\") + \"'\";\ndef threatQueryUrl = \"https://${host}/api/?type=log&log-type=threat&nlogs=5000&query=(${java.net.URLEncoder.encode(threatQuery)})&key=${apikey}\";\ndef threatQueryResponse = new XmlSlurper().parseText(HTTP.body(threatQueryUrl));\n\n// get the report job ids \ndef jobIdArray = threatQueryResponse.depthFirst().findAll { it.name() == 'job' }\n\n// init an eventList\ndef eventList = [];\n\n// identify any jobs\njobIdArray.each\n{ jobId ->\n\n // now that we have the job id, retrieve the report\n def reportQueryUrl = \"https://${host}/api/?type=log&action=get&job-id=${jobId}&key=${apikey}\";\n\n // retry loop to retrieve report\n for (int i = 0; i <= 10; i++)\n {\n // get the report bad parse the XML\n def string = HTTP.body(reportQueryUrl);\n def reportXML = new XmlSlurper().parseText(string);\n\n // did this report finish?\n if (reportXML.result.job.status == \"FIN\")\n {\n // yes -- get the report entries\n def entrys = reportXML.depthFirst().findAll { it.name() == 'entry' };\n\n // iterate over each report entry\n entrys.each\n { entry ->\n\n // is this entry a logid?\n if (entry.@'logid'.toString())\n {\n // yes -- is the severity of this entry \"high\" or \"critical\"\n if (entry.severity.toString().contains(\"high\") || entry.severity.toString().contains(\"critical\"))\n {\n // add an event to the eventList\n eventList.push([\n happenedOn: entry.time_generated.toString(),\n severity : \"warn\",\n source : host,\n message : \"${entry.severity.toString()} :: [${entry.@'logid'}] ${entry.type} - ${entry.subtype.toString().capitalize()} : ${entry.threatid} (${entry.direction} ${entry.src} -> ${entry.dst})\"\n ]);\n }\n }\n }\n\n break;\n }\n else\n {\n // job didn't finish, lets sleep for a bit and try again.\n sleep(50)\n }\n }\n}\n\ndef events = [events: eventList];\n\n\nprintln(new JsonBuilder(events).toPrettyString());\n\nreturn (0);"}, "schedule": "30m"}]}

×EventSource: Cisco DNAC Issues (3)

{"name": "Cisco DNAC Issues", "appliesTo": "hasCategory(\"Cisco_DNAC\") && system.collectorversion >= 29100", "description": "List of global issues, issues for a specific device, or issue for a specific client device's MAC address.", "searchKeywords": "dnac,dna,cisco,issues", "technicalNotes": "https://developer.cisco.com/docs/dna-center/#!issues-issues\n\nThis script attempts to prevent duplicate events using script caching in the collector (requires collector version 29.100 or higher). For details see: https://www.logicmonitor.com/support/collectors/collector-configurations/collector-script-caching", "severity": "warn", "collectionMethod": "scriptevent", "clearAfterMin": 60, "clearAfterAck": false, "doMapping": true, "collectionAttrs": [{"script": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonOutput\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\nimport java.util.Date\nimport java.text.SimpleDateFormat \n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\ndef collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\ndef modLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n\ndef lmDNAC = modLoader.load(\"cisco.dnac\", \"0\") // Load Cisco DNAC module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct DNACSnippet class from snippet\nsnip = lmDNAC.DNACSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\ndef pollInterval = taskProps.get(\"pollinterval\") ?: 60\ndef cacheDedupTimeout = 360 // Timeout in minutes for deduplication of errors. Set to 6 hours for now.\n\n// Set time range params for query\ndef endEpoch = System.currentTimeMillis()\nInteger lookbackInt = 21600 // dynamic lookback was missing events, hardcoded to 6 hours\ndef startEpoch = endEpoch - (lookbackInt * 1000)\ndef params = \"?startTime=${startEpoch}&endTime=${endEpoch}\"\n\ndef response = snip.httpGet(\"issues${params}\")\n \n// Establish map for issues found to be printed at once in JSON format\nMap json = [:]\njson[\"events\"] = []\n\n// Transform API severity to LM severity\nMap severity = [\n \"P1\" : \"critical\",\n \"P2\" : \"error\",\n \"P3\" : \"warn\"\n]\n\nif (response) {\n response?.response.each{ issue ->\n if (issue.status == \"active\" || issue.status == \"ACTIVE\") {\n // Create a unique hash of each response to store in collector cache to exclude issues we've already seen\n // Some responses can return without an issueId, so we create our own unique identifier\n def uniqueId = issue.hashCode()\n\n // Temporary container for this issue\n Map dnacIssue = [:]\n def dedupSuppress = false\n\n // Check to see if this issue is in the script cache\n if (collectorCache.get(\"DNACissue.${uniqueId}\")){\n snip.LMDebugPrint(\"Skipping issue ${uniqueId}, already reported\")\n dedupSuppress = true\n }\n\n if (!dedupSuppress) {\n // Convert date to a format LM can read properly\n Date dateRaw = new Date(issue.last_occurence_time)\n def formatDate = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSZZ\").format(dateRaw)\n \n // Mandatory fields\n dnacIssue[\"happenedOn\"] = formatDate\n dnacIssue[\"severity\"] = severity[issue.priority] ?: \"warn\"\n dnacIssue[\"message\"] = \"${issue.deviceRole} - ${issue.name}\\nThis issue has occurred ${issue.issue_occurence_count} times.\"\n // Custom fields\n dnacIssue[\"aiDriven\"] = issue.aiDriven\n dnacIssue[\"siteId\"] = issue.siteId\n dnacIssue[\"deviceId\"] = issue.deviceId\n dnacIssue[\"deviceRole\"] = issue.deviceRole\n dnacIssue[\"clientMac\"] = issue.clientMac\n dnacIssue[\"category\"] = issue.category\n\n json[\"events\"] << dnacIssue\n\n if (collectorCache){\n collectorCache.set(\"DNACissue.${uniqueId}\",\"1\",cacheDedupTimeout * 60 * 1000)\n }\n }\n }\n }\n // Did we get any new issues?\n if (json['events'].size > 0) {\n // Yes, convert the json map to a JSON string and print it pretty\n println JsonOutput.prettyPrint(JsonOutput.toJson(json))\n } \n}\nelse {\n println \"Error occurred. Try debug mode\"\n return 1\n}\n\nreturn 0"}, "schedule": "5m"}]}

×DataSource: WinIf- (137)

{"name": "WinIf-", "description": "Windows interface statistics", "appliesTo": "isWindows() && !(hasCategory(\"WSFC_VNN\") || hasCategory(\"NLB_VNN\"))", "searchKeywords": "os,windows,interface", "displayedAs": "Interfaces-", "collectionInterval": "5m", "collectionMethod": "wmi", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_wmi", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"namespace": "CIMV2", "class": "Win32_PerfRawData_Tcpip_NetworkInterface", "property": "name"}, "filters": [{"attr": "name", "op": "NotContain", "value": "Loopback"}, {"attr": "name", "op": "NotContain", "value": "Teredo", "comment": "IPv6"}, {"attr": "name", "op": "NotContain", "value": "isatap", "comment": "IPv6"}, {"attr": "name", "op": "NotContain", "value": "Citrix", "comment": "XenServer VM's have own datasource"}], "groupMethod": "none"}, "collectionAttrs": {"namespace": "CIMV2", "collectionType": "query", "class": "Win32_PerfRawData_Tcpip_NetworkInterface", "indexProperty": "name", "indexValue": "##WILDVALUE##"}, "datapoints": [{"name": "BytesReceivedPerSec", "config": {"wmiClassAttr": "BytesReceivedPerSec"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 4, "clearInterval": 0}, {"name": "BytesSentPerSec", "config": {"wmiClassAttr": "BytesSentPerSec"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 4, "clearInterval": 0}, {"name": "OutboundBitsPerSec", "config": {}, "interpretMethod": "expression", "interpretExpr": "BytesSentPerSec*8", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "PacketsOutboundDiscarded", "config": {"wmiClassAttr": "PacketsOutboundDiscarded"}, "interpretMethod": "none", "type": "derive", "dataType": 4, "min": "0", "threshold": "> 1", "noData": "Do not trigger an alert", "triggerInterval": 4, "clearInterval": 0, "alertBody": "The ##INSTANCE## ##DSIDESCRIPTION## interface on ##HOST## is discarding ##VALUE## packets per second outbound. \nThis is a ##LEVEL## state - it started at ##START## and has so far been going on for ##DURATION##.\nThis could be due to buffer overflows caused by speed/duplex mismatches."}, {"name": "PacketsReceivedDiscarded", "config": {"wmiClassAttr": "PacketsReceivedDiscarded"}, "interpretMethod": "none", "type": "derive", "dataType": 4, "min": "0", "threshold": "> 1", "noData": "Do not trigger an alert", "triggerInterval": 4, "clearInterval": 0, "alertBody": "The ##INSTANCE## ##DSIDESCRIPTION## interface on ##HOST## is discarding ##VALUE## packets per second inbound. \nThis is a ##LEVEL## state - it started at ##START## and has so far been going on for ##DURATION##.\nThis could be due to buffer overflows caused by speed/duplex mismatches."}, {"name": "PacketsReceivedNonUnicastPerSec", "config": {"wmiClassAttr": "PacketsReceivedNonUnicastPerSec"}, "interpretMethod": "none", "type": "derive", "dataType": 4, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 4, "clearInterval": 0}, {"name": "PacketsReceivedUnicastPerSec", "config": {"wmiClassAttr": "PacketsReceivedUnicastPerSec"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 4, "clearInterval": 0}, {"name": "PacketsSentNonUnicastPerSec", "config": {"wmiClassAttr": "PacketsSentNonUnicastPerSec"}, "interpretMethod": "none", "type": "derive", "dataType": 4, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 4, "clearInterval": 0}, {"name": "PacketsSentUnicastPerSec", "config": {"wmiClassAttr": "PacketsSentUnicastPerSec"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 4, "clearInterval": 0}, {"name": "ReceivedBitsPerSec", "config": {}, "interpretMethod": "expression", "interpretExpr": "BytesReceivedPerSec*8", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}], "graphs": [{"name": "Discards", "title": "Discards for ##INSTANCE## ##DESCRIPTION##", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "PacketsOutboundDiscarded", "datapointName": "PacketsOutboundDiscarded", "consolidationFn": "max"}, {"name": "PacketsReceivedDiscarded", "datapointName": "PacketsReceivedDiscarded", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Out discards", "color": "green", "datapointName": "PacketsOutboundDiscarded", "isVirtual": false}, {"type": "line", "legend": "In Discards", "color": "blue", "datapointName": "PacketsReceivedDiscarded", "isVirtual": false}]}, {"name": "Packets", "title": "Max Packets/sec for ##INSTANCE##", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 1, "timeScale": "day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PacketsReceivedNonUnicastPerSec", "datapointName": "PacketsReceivedNonUnicastPerSec", "consolidationFn": "max"}, {"name": "PacketsReceivedUnicastPerSec", "datapointName": "PacketsReceivedUnicastPerSec", "consolidationFn": "max"}, {"name": "PacketsSentNonUnicastPerSec", "datapointName": "PacketsSentNonUnicastPerSec", "consolidationFn": "max"}, {"name": "PacketsSentUnicastPerSec", "datapointName": "PacketsSentUnicastPerSec", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "In non-unicast", "color": "blue", "datapointName": "PacketsReceivedNonUnicastPerSec", "isVirtual": false}, {"type": "line", "legend": "In unicast", "color": "aqua", "datapointName": "PacketsReceivedUnicastPerSec", "isVirtual": false}, {"type": "line", "legend": "Out non-unicast", "color": "green", "datapointName": "PacketsSentNonUnicastPerSec", "isVirtual": false}, {"type": "line", "legend": "Out unicast", "color": "lime", "datapointName": "PacketsSentUnicastPerSec", "isVirtual": false}]}, {"name": "Throughput", "title": "Max BPS for ##INSTANCE##", "verticalLabel": "bps", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "OutboundBitsPerSec", "datapointName": "OutboundBitsPerSec", "consolidationFn": "max"}, {"name": "ReceivedBitsPerSec", "datapointName": "ReceivedBitsPerSec", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Out", "color": "blue", "datapointName": "OutboundBitsPerSec", "isVirtual": false}, {"type": "line", "legend": "In", "color": "green", "datapointName": "ReceivedBitsPerSec", "isVirtual": false}]}], "eriConfig": {"eriEnabled": true, "eriScript": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.win32.WMI\n\nmodLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\nlmtopo = modLoader.load(\"lm.topo\", \"0\")\nlmtopoData = modLoader.load(\"lm.data.topo\", \"0\")\nlmtopoData.run()\n\ndef host = hostProps.get(\"system.hostname\")\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\ndef debug = false\n\ndef interfaceEri = []\ndef interfaceNameWildvalue = instanceProps.get(\"wildvalue\")\nWMI.queryAll(host, \"select * from Win32_NetworkAdapter\").each { adapter ->\n \n if (debug) println \"\\nFound network adapter:\\n ${adapter}\\n\"\n \n if (interfaceNameWildvalue != adapter.NAME) {\n if (debug) println \"\\n Network adapter name (${adapter.NAME}) does not match wildvalue name (${interfaceNameWildvalue})\\n\"\n return\n }\n\n // Block adapters with no MAC, interface index or are WAN type\n if (adapter.MACADDRESS != \"\" && adapter.INTERFACEINDEX != \"\" && !adapter.DESCRIPTION?.toLowerCase()?.contains(\"miniport\")) {\n macAddr = adapter.MACADDRESS.toLowerCase()\n if(!lmtopo.isMac(macAddr, lmtopoData.blockedKeys, debug)) return\n\n // Account for Hyper-V resources\n if (macAddr.startsWith(\"00:1d:d8\")) {\n def ouiStrippedMac = macAddr.tokenize(\":\")[3..-1].join(\"\")\n def longMac = Long.parseLong(ouiStrippedMac, 16)\n def lowerBound = Long.parseLong(\"b71c00\", 16) // 00:1D:D8:B7:1C:00\n def upperBound = Long.parseLong(\"f41fff\", 16) // 00:1D:D8:F4:1F:FF\n def bounds = lowerBound..upperBound\n if (bounds.contains(longMac)) return\n }\n\n interfaceEri << \"interface:${macAddr}\"\n if (debug) println \" Set physical adapter ${adapter.NAME} MAC ERI: ${macAddr}\\n\"\n }\n}\n\nif (!interfaceEri.isEmpty()) {\n println 'predef.externalResourceID=' + lmtopo.eriPreProcessor(interfaceEri, lmtopoData.blockedKeys, keyNamespace, keyBlacklist) \n println 'predef.externalResourceType=Interface' \n}\n\nreturn 0"}}}

×DataSource: CiscoSLA_jitter- (650)

{"name": "CiscoSLA_jitter-", "description": "Cisco SLA Jitter monitoring", "appliesTo": "hasCategory(\"Cisco\")", "searchKeywords": "jitter,sla,cisco,network", "technicalNotes": "Requires IP SLA be enabled on the device.\nAn alert threshold of \"=0\" can optionally be set on the MOSDataNotGenratedAlerts datapoint to generate an alert when MOS data is not generated for an instance.", "displayedAs": "Cisco SLA Jitter", "collectionInterval": "1m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_snmp", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"discoveryType": "wildcard", "oid": ".1.3.6.1.4.1.9.9.42.1.2.1.1.3", "descriptionOid": ".1.3.6.1.4.1.9.9.42.1.2.1.1.2"}, "filters": [{"attr": ".1.3.6.1.4.1.9.9.42.1.2.1.1.4", "op": "Equal", "value": "9", "comment": "RTT Monitor is of type Jitter"}, {"attr": ".1.3.6.1.4.1.9.9.42.1.2.9.1.10", "op": "Equal", "value": "6", "comment": "and monitor is active"}], "groupMethod": "none"}, "datapoints": [{"name": "DSLoss", "description": "The number of packets lost from destination to source.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.27.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ICPIF", "description": "The Calculated Planning Impairment Factor (ICPIF) value for the operation. The ICPIF value is computed by IP SLAs using the formula \n\nIcpif = Io + Iq + Idte + Idd + Ie - A\n\nWhere:\n- The values for Io, Iq, and Idte are set to zero.\n- The value Idd is computed based on the measured one-way delay.\n- The value Ie is computed based on the measured packet loss.\n- The value of A is specified by the user.\n\nICPIF values are expressed in a typical range of 5 (very low impairment) to 55 (very high impairment). ICPIF values numerically lower than 20 are generally considered \"adequate.\"\n\nNote This value is intended only for relative comparisons, and may not match ICPIF values generated using alternate methods.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.43.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "MOS", "description": "The estimated Mean Opinion Score (Conversational Quality, Estimated) for the latest iteration of the operation. The MOS-CQE is computed by IP SLAs as a function of the ICPIF.\n\nMOS values are expressed as a number from 100 to 500, with 500 being the highest level of quality, and 100 being the lowest level of quality. A MOS value of 0 (zero) indicates that MOS data could not be generated for the operation.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.42.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MOSAlerts", "description": "Alerts for MOS values that are lower than the set threshold. Ignores MOS 0 values (indicates that MOS data could not be generated for the operation).", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(eq(MOS,0),unkn(),MOS)", "type": "gauge", "dataType": 7, "threshold": "<= 400", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 1, "alertBody": "The MOS score on the IP SLA responder ##INSTANCE## (##DESCRIPTION##) from ##HOST## is currently ##VALUE##, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago.\n\nMOS values are expressed as a number from 100 to 500, with 500 being the highest level of quality, and 100 being the lowest level of quality."}, {"name": "MOSDataNotGenratedAlerts", "description": "Optional alert for MOS status 0 which indicates that MOS data could not be generated.", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(eq(MOS, 0),0,unkn())", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The MOS score on the IP SLA responder ##INSTANCE## (##DESCRIPTION##) from ##HOST## is currently ##VALUE##, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago.\n\nA MOS value of 0 indicates that MOS data could not be generated for the operation."}, {"name": "NumNegativeDS", "description": "The number of jitter values from destination to source that are negative (that is, network latency decreases for two consecutive test packets).", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.23.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "NumNegativeSD", "description": "The number of jitter values from source to destination that are negative (that is, network latency decreases for two consecutive test packets).", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.13.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "NumPositiveDS", "description": "The number of jitter values from destination to source that are positive (that is, network latency increases for two consecutive test packets).", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.18.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "NumPositiveSD", "description": "The number of jitter values from source to destination that are positive (that is, network latency increases for two consecutive test packets).", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.8.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "NumRTT", "description": "The number of successful round-trips.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.1.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SDLoss", "description": "The number of packets lost from source to destination.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.26.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "Sum2NegativeDS", "description": "The sum of the squares of the number of jitter values from destination to source that are negative.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.25.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "Sum2NegativeSD", "description": "The sum of the squares of the number of jitter values from source to destination that are negative.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.15.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "Sum2PositiveDS", "description": "The sum of the squares of the number of jitter values from destination to source that are positive.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.20.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "Sum2PositiveSD", "description": "The sum of the squares of the number of jitter values from source to destination that are positive.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.10.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "Sum2RTT", "description": "The sum of squares of round-trip values (in milliseconds).", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.3.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SumNegativeDS", "description": "The sum of the number of jitter values from destination to source that are negative.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.24.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SumNegativeSD", "description": "The sum of the number of jitter values from source to destination that are negative.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.14.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SumPositiveDS", "description": "The sum of the number of jitter values from destination to source that are positive.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.19.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SumPositiveSD", "description": "The sum of the number of jitter values from source to destination that are positive.", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.9.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SumRTT", "description": "The sum of round-trip values (in milliseconds).", "config": {"oid": ".1.3.6.1.4.1.9.9.42.1.5.2.1.2.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}], "graphs": [{"name": "ICPIF", "title": "ICPIF for ##INSTANCE## ##DESCRIPTION##", "verticalLabel": "score", "min": 0.0, "displayPriority": 1, "timeScale": "5hour", "scale1024": false, "rigid": false, "datapoints": [{"name": "ICPIF", "datapointName": "ICPIF", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Calculated Planning Impairment Factor", "color": "orange", "datapointName": "ICPIF", "isVirtual": false}]}, {"name": "Jitter", "title": "Jitter for ##INSTANCE## ##DESCRIPTION##", "verticalLabel": "milliseconds", "displayPriority": 1, "timeScale": "5hour", "scale1024": false, "rigid": false, "datapoints": [{"name": "NumNegativeDS", "datapointName": "NumNegativeDS", "consolidationFn": "average"}, {"name": "NumNegativeSD", "datapointName": "NumNegativeSD", "consolidationFn": "average"}, {"name": "NumPositiveDS", "datapointName": "NumPositiveDS", "consolidationFn": "average"}, {"name": "NumPositiveSD", "datapointName": "NumPositiveSD", "consolidationFn": "average"}, {"name": "Sum2NegativeDS", "datapointName": "Sum2NegativeDS", "consolidationFn": "average"}, {"name": "Sum2NegativeSD", "datapointName": "Sum2NegativeSD", "consolidationFn": "average"}, {"name": "Sum2PositiveDS", "datapointName": "Sum2PositiveDS", "consolidationFn": "average"}, {"name": "Sum2PositiveSD", "datapointName": "Sum2PositiveSD", "consolidationFn": "average"}, {"name": "SumNegativeDS", "datapointName": "SumNegativeDS", "consolidationFn": "average"}, {"name": "SumNegativeSD", "datapointName": "SumNegativeSD", "consolidationFn": "average"}, {"name": "SumPositiveDS", "datapointName": "SumPositiveDS", "consolidationFn": "average"}, {"name": "SumPositiveSD", "datapointName": "SumPositiveSD", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "MeanDSNegative", "expr": "0-(SumNegativeDS/NumNegativeDS)"}, {"name": "MeanDSPositive", "expr": "SumPositiveDS/NumPositiveDS"}, {"name": "MeanSDNegative", "expr": "0-(SumNegativeSD/NumNegativeSD)"}, {"name": "MeanSDPositive", "expr": "SumPositiveSD/NumPositiveSD"}, {"name": "VarianceDSNegative", "expr": "(Sum2NegativeDS - SumNegativeDS*SumNegativeDS/NumNegativeDS)/(NumNegativeDS-1)"}, {"name": "VarianceDSPositive", "expr": "(Sum2PositiveDS - SumPositiveDS*SumPositiveDS/NumPositiveDS)/(NumPositiveDS-1)"}, {"name": "VarianceSDNegative", "expr": "(Sum2NegativeSD - SumNegativeSD*SumNegativeSD/NumNegativeSD)/(NumNegativeSD-1)"}, {"name": "VarianceSDPositive", "expr": "(Sum2PositiveSD - SumPositiveSD*SumPositiveSD/NumPositiveSD)/(NumPositiveSD-1)"}, {"name": "95_DSNeg", "expr": "MeanDSNegative-2*SD_DSNeg"}, {"name": "95_DSPos", "expr": "MeanDSPositive+2*SD_DSPos"}, {"name": "95_SDPos", "expr": "MeanSDPositive+2*SD_SDPos"}, {"name": "SD_DSNeg", "expr": "sqrt(VarianceDSNegative)"}, {"name": "SD_DSPos", "expr": "sqrt(VarianceDSPositive)"}, {"name": "SD_SDNeg", "expr": "sqrt(VarianceSDNegative)"}, {"name": "95_SDNeg", "expr": "MeanSDNegative-2*SD_SDNeg"}, {"name": "SD_SDPos", "expr": "sqrt(VarianceSDPositive)"}], "lines": [{"type": "line", "legend": "95% DS", "color": "teal", "datapointName": "95_DSNeg", "isVirtual": true}, {"type": "line", "legend": "95% DS", "color": "teal", "datapointName": "95_DSPos", "isVirtual": true}, {"type": "area", "legend": "95% SD", "color": "aqua", "datapointName": "95_SDNeg", "isVirtual": true}, {"type": "area", "legend": "95% SD", "color": "aqua", "datapointName": "95_SDPos", "isVirtual": true}, {"type": "line", "legend": "Mean DS", "color": "green", "datapointName": "MeanDSNegative", "isVirtual": true}, {"type": "line", "legend": "Mean DS", "color": "green", "datapointName": "MeanDSPositive", "isVirtual": true}, {"type": "area", "legend": "Mean SD", "color": "blue", "datapointName": "MeanSDNegative", "isVirtual": true}, {"type": "area", "legend": "Mean DS", "color": "blue", "datapointName": "MeanSDPositive", "isVirtual": true}]}, {"name": "MOS_score", "title": "MOS score for ##INSTANCE## ##DESCRIPTION##", "verticalLabel": "score", "min": 0.0, "displayPriority": 1, "timeScale": "5hour", "scale1024": false, "rigid": false, "datapoints": [{"name": "MOSRaw", "datapointName": "MOS", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "MOS", "expr": "MOSRaw/100"}], "lines": [{"type": "line", "legend": "MOS", "color": "blue", "datapointName": "MOS", "isVirtual": true}]}, {"name": "Packet Loss", "title": "Packet Loss for ##INSTANCE## ##DESCRIPTION##", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "5hour", "scale1024": false, "rigid": false, "datapoints": [{"name": "DSLoss", "datapointName": "DSLoss", "consolidationFn": "average"}, {"name": "SDLoss", "datapointName": "SDLoss", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "DS Loss", "color": "orange", "datapointName": "DSLoss", "isVirtual": false}, {"type": "line", "legend": "SD Loss", "color": "red", "datapointName": "SDLoss", "isVirtual": false}]}, {"name": "RTT", "title": "RTT for ##INSTANCE## ##DESCRIPTION##", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 1, "timeScale": "5hour", "scale1024": false, "rigid": false, "datapoints": [{"name": "NumRTT", "datapointName": "NumRTT", "consolidationFn": "average"}, {"name": "Sum2RTT", "datapointName": "Sum2RTT", "consolidationFn": "average"}, {"name": "SumRTT", "datapointName": "SumRTT", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "MeanRTT", "expr": "SumRTT/NumRTT"}, {"name": "Variance", "expr": "(Sum2RTT - SumRTT*SumRTT/NumRTT)/(NumRTT-1)"}, {"name": "SD", "expr": "sqrt(Variance)"}, {"name": "MeanPlus2SD", "expr": "MeanRTT+ 2 * SD"}], "lines": [{"type": "area", "legend": "95% RTT", "color": "red", "datapointName": "MeanPlus2SD", "isVirtual": true}, {"type": "area", "legend": "Mean", "color": "green", "datapointName": "MeanRTT", "isVirtual": true}]}], "overviewGraphs": [{"name": "Top Responders by Destination to Source Packet Loss", "title": "Top Responders by Destination to Source Packet Loss", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "SDLoss", "datapointName": "DSLoss", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "SDLoss", "isVirtual": false}]}, {"name": "Top Responders by ICPIF", "title": "Top Responders by ICPIF", "verticalLabel": "score", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ICPIF", "datapointName": "ICPIF", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "ICPIF", "isVirtual": false}]}, {"name": "Top Responders by Source to Destination Packet Loss", "title": "Top Responders by Source to Destination Packet Loss", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "SDLoss", "datapointName": "SDLoss", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "SDLoss", "isVirtual": false}]}]}

×DataSource: WinSystemUptime (997)

{"name": "WinSystemUptime", "description": "Windows host system uptime via WMI", "appliesTo": "isWindows()", "group": "Host Status", "searchKeywords": "application,os,windows,microsoft,uptime", "displayedAs": "System Uptime", "collectionInterval": "5m", "collectionMethod": "wmi", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"namespace": "CIMV2", "collectionType": "query", "class": "Win32_PerfRawData_PerfOS_System", "indexProperty": "@", "indexValue": "@"}, "datapoints": [{"name": "SystemUpTime", "description": "Elapsed time (in seconds) that the computer has been running after it was last started. This property displays the difference between the start time and the current time.", "config": {"wmiClassAttr": "SystemUpTime"}, "interpretMethod": "none", "type": "gauge", "dataType": 5, "min": "0", "noData": "Trigger warning alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "No WMI data is being collected from ##HOST##.\nThis started at ##START##.\nThis means the LogicMonitor agent does not have permissions to collect data from ##HOST##, or the traffic is being blocked.\nIf the host is in a domain, ensure the LogicMonitor agent service is running as a domain account that has local administrator privileges on the host, or running as LocalSystem on a domain controller.\n\nEnsure there are no firewalls preventing the agent from accessing the host."}, {"name": "Timestamp_Object", "description": "High Performance counter timestamp.", "config": {"wmiClassAttr": "Timestamp_Object"}, "interpretMethod": "none", "type": "gauge", "dataType": 5, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "UptimeDays", "description": "System uptime in days.", "config": {}, "interpretMethod": "expression", "interpretExpr": "(Timestamp_object-SystemUpTime)/86400/10000000", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "##HOST## is reporting it has only been up for ##VALUE## days, as of ##START##.\nIf this was an unexpected reboot, please investigate the system logs."}, {"name": "UptimeSeconds", "description": "System uptime in seconds.", "config": {}, "interpretMethod": "expression", "interpretExpr": "(Timestamp_object-SystemUpTime)/10000000", "type": "gauge", "dataType": 4, "threshold": "<= 3600 3600", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "##HOST## is reporting it has only been up for ##VALUE## seconds, as of ##START##.\nIf this was an unexpected reboot, please investigate the system logs."}], "graphs": [{"name": "SystemUptime", "title": "System Uptime", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "SystemUpTime", "datapointName": "SystemUpTime", "consolidationFn": "average"}, {"name": "Timestamp_Object", "datapointName": "Timestamp_Object", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "UptimeDays", "expr": "(Timestamp_object-SystemUpTime)/86400/10000000"}], "lines": [{"type": "line", "legend": "UptimeDays", "color": "green", "datapointName": "UptimeDays", "isVirtual": true}]}]}

×DataSource: Netscaler_lb_vip- (744)

{"name": "Netscaler_lb_vip-", "description": "Statistics for load balancing VIPs", "appliesTo": "hasCategory(\"NetscalersActive\")", "group": "Netscaler VServers", "searchKeywords": "load balancer,netscaler,vip,citrix,network", "displayedAs": "Load Balancing VIPs-", "collectionInterval": "2m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp;\n\ndef SERVICE_TYPE_NAME = [:]\nSERVICE_TYPE_NAME[\"0\"] = \"http\"\nSERVICE_TYPE_NAME[\"1\"] = \"ftp\"\nSERVICE_TYPE_NAME[\"2\"] = \"tcp\"\nSERVICE_TYPE_NAME[\"3\"] = \"udp\"\nSERVICE_TYPE_NAME[\"4\"] = \"sslBridge\"\nSERVICE_TYPE_NAME[\"5\"] = \"monitor\"\nSERVICE_TYPE_NAME[\"6\"] = \"monitorUdp\"\nSERVICE_TYPE_NAME[\"7\"] = \"nntp\"\nSERVICE_TYPE_NAME[\"8\"] = \"httpserver\"\nSERVICE_TYPE_NAME[\"9\"] = \"httpclient\"\nSERVICE_TYPE_NAME[\"10\"] = \"rpcserver\"\nSERVICE_TYPE_NAME[\"11\"] = \"rpcclient\"\nSERVICE_TYPE_NAME[\"12\"] = \"nat\"\nSERVICE_TYPE_NAME[\"13\"] = \"any\"\nSERVICE_TYPE_NAME[\"14\"] = \"ssl\"\nSERVICE_TYPE_NAME[\"16\"] = \"dns\"\nSERVICE_TYPE_NAME[\"17\"] = \"adns\"\nSERVICE_TYPE_NAME[\"18\"] = \"snmp\"\nSERVICE_TYPE_NAME[\"19\"] = \"ha\"\nSERVICE_TYPE_NAME[\"20\"] = \"monitorPing\"\nSERVICE_TYPE_NAME[\"21\"] = \"sslOtherTcp\"\nSERVICE_TYPE_NAME[\"22\"] = \"aaa\"\nSERVICE_TYPE_NAME[\"23\"] = \"secureMonitor\"\nSERVICE_TYPE_NAME[\"24\"] = \"sslvpnUdp\"\nSERVICE_TYPE_NAME[\"25\"] = \"rip\"\nSERVICE_TYPE_NAME[\"26\"] = \"dnsClient\"\nSERVICE_TYPE_NAME[\"27\"] = \"rpcServer\"\nSERVICE_TYPE_NAME[\"28\"] = \"rpcClient\"\nSERVICE_TYPE_NAME[\"36\"] = \"dhcrpa\"\nSERVICE_TYPE_NAME[\"39\"] = \"sipudp\"\nSERVICE_TYPE_NAME[\"40\"] = \"siptcp\"\nSERVICE_TYPE_NAME[\"41\"] = \"siptls\"\nSERVICE_TYPE_NAME[\"48\"] = \"dnstcp\"\nSERVICE_TYPE_NAME[\"49\"] = \"adnstcp\"\nSERVICE_TYPE_NAME[\"50\"] = \"rtsp\"\nSERVICE_TYPE_NAME[\"52\"] = \"push\"\nSERVICE_TYPE_NAME[\"53\"] = \"sslPush\"\nSERVICE_TYPE_NAME[\"54\"] = \"dhcpClient\"\nSERVICE_TYPE_NAME[\"55\"] = \"radius\"\nSERVICE_TYPE_NAME[\"61\"] = \"rdp\"\nSERVICE_TYPE_NAME[\"62\"] = \"mysql\"\nSERVICE_TYPE_NAME[\"63\"] = \"mssql\"\nSERVICE_TYPE_NAME[\"73\"] = \"diameter\"\nSERVICE_TYPE_NAME[\"74\"] = \"sslDiameter\"\nSERVICE_TYPE_NAME[\"75\"] = \"tftp\"\nSERVICE_TYPE_NAME[\"90\"] = \"tftp\"\nSERVICE_TYPE_NAME[\"91\"] = \"pptp\"\nSERVICE_TYPE_NAME[\"92\"] = \"gre\"\nSERVICE_TYPE_NAME[\"95\"] = \"fix\"\nSERVICE_TYPE_NAME[\"96\"] = \"sslFix\"\nSERVICE_TYPE_NAME[\"99\"] = \"serviceUnknown\"\n\ndef props = hostProps.toProperties()\ndef hostname = hostProps.get(\"system.hostname\")\n\ndef vsvrIpAddress = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.5951.4.1.3.1.1.2\", props)\ndef vsvrPort = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.5951.4.1.3.1.1.3\", props)\ndef vsvrType = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.5951.4.1.3.1.1.4\", props)\n\nSnmp.walkAsMap(hostname, \"1.3.6.1.4.1.5951.4.1.3.1.1.59\", props).each { index, fullName ->\n def ilp = [:]\n ilp[\"netscaler.vserver.ip_address\"] = vsvrIpAddress[index]\n ilp[\"netscaler.vserver.port\"] = vsvrPort[index]\n ilp[\"netscaler.vserver.type\"] = SERVICE_TYPE_NAME.get(vsvrType[index], vsvrType[index])\n\n println \"${index}##${fullName}######${ilp.collect {\"auto.${it.key}=${it.value}\"}.join('&')}\"\n}\n\nreturn 0"}, "filters": [{"attr": ".1.3.6.1.4.1.5951.4.1.3.6.1.1", "op": "Exist", "value": "*", "comment": "If a load balancing method exists for this VIP, it is a lb vserver"}], "groupMethod": "none"}, "datapoints": [{"name": "AlertingServicesDown", "description": "The current number of services which are bound to this vserver and are in the state 'down'.", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(eq(State,7),ServicesDown,0)", "type": "gauge", "dataType": 7, "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "There are ##VALUE## services down for the load balancing service ##INSTANCE## ##DSIDESCRIPTION## on netscaler ##HOST##. \nThis has been the case since ##START## - or for ##DURATION## \nThe error is ##LEVEL##"}, {"name": "AvgTimeToFirstByte", "description": "Average TTFB between the NetScaler appliance and the server. TTFB is the time interval between sending the request packet to a service and receiving the first response from the service.", "config": {"oid": ".1.3.6.1.4.1.5951.4.1.3.6.1.5.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "ClientConnections", "description": "Number of current client connections.", "config": {"oid": ".1.3.6.1.4.1.5951.4.1.3.1.1.7.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "Health", "description": "The percentage of UP services bound to this vserver.", "config": {"oid": "1.3.6.1.4.1.5951.4.1.3.1.1.62.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RequestBytes", "description": "Request rate in bytes per second for this service or virtual server.", "config": {"oid": ".1.3.6.1.4.1.5951.4.1.3.1.1.44.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "max": "1250000000", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "Requests", "description": "Total number of requests received on this service or virtual server. (This applies to HTTP/SSL services and servers.)", "config": {"oid": ".1.3.6.1.4.1.5951.4.1.3.1.1.30.##WILDVALUE##"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "min": "0", "max": "1000000", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "ResponseBytes", "description": "Response rate in bytes per second for this service or virtual server.", "config": {"oid": ".1.3.6.1.4.1.5951.4.1.3.1.1.45.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "max": "1250000000", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "Responses", "description": "Number of responses received on this service or virtual server. (This applies to HTTP/SSL services and servers.)", "config": {"oid": "1.3.6.1.4.1.5951.4.1.3.1.1.32.##WILDVALUE##"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServerConnections", "description": "Number of current connections to the actual servers behind the virtual server.", "config": {"oid": ".1.3.6.1.4.1.5951.4.1.3.1.1.8.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "ServicesDown", "description": "The current number of services which are bound to this vserver and are in the state 'down'.", "config": {"oid": ".1.3.6.1.4.1.5951.4.1.3.1.1.37.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "ServicesOutOfSvc", "description": "The current number of services which are bound to this vserver and are in the state 'outOfService'.", "config": {"oid": ".1.3.6.1.4.1.5951.4.1.3.1.1.39.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "ServicesTotal", "description": "The current number of services which are bound to this vserver.", "config": {"oid": "1.3.6.1.4.1.5951.4.1.3.1.1.61.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServicesTransToOutOfSvc", "description": "The current number of services which are bound to this vserver and are in the state 'outOfService'.", "config": {"oid": "1.3.6.1.4.1.5951.4.1.3.1.1.40.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServicesUp", "description": "The current number of services which are bound to this vserver and are in the state 'up'.", "config": {"oid": ".1.3.6.1.4.1.5951.4.1.3.1.1.41.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0}, {"name": "State", "description": "Current state of the server. 7=UP everything else is generates an alert", "config": {"oid": ".1.3.6.1.4.1.5951.4.1.3.1.1.5.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 7", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The load balancing VIP ##INSTANCE## ##DSIDESCRIPTION## on ##HOST## is not up - it is reporting state ##VALUE##.\nThe state values are:\n1 - down\n2 - unknown\n3 - busy\n4 - outOfService\n5 - Transitioning To OutOfService\n7 - Up\n8 - Out Transition to OutOfServiceDown\nThis started at ##START## - or ##DURATION## ago.\nThe current state is ##LEVEL##."}, {"name": "SurgeCount", "description": "The surge queue of the virtual server - only valid for builds later than 8.1 Build 68_7.", "config": {"oid": ".1.3.6.1.4.1.5951.4.1.3.1.1.10.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 20", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "There are ##VALUE## connections in the surge queue for VIP ##INSTANCE## ##DSIDESCRIPTION## on ##HOST##.\nThis started at ##START## - or ##DURATION## ago.\nThe current surge level is ##LEVEL##."}, {"name": "SynfloodRate", "description": "Rate of unacknowledged SYN packets for this service or virtual server.", "config": {"oid": "1.3.6.1.4.1.5951.4.1.3.1.1.46.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotHits", "description": "Total vserver hits", "config": {"oid": "1.3.6.1.4.1.5951.4.1.3.1.1.48.##WILDVALUE##"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotMiss", "description": "Total vserver misses", "config": {"oid": "1.3.6.1.4.1.5951.4.1.3.1.1.42.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotSpillOvers", "description": "Number of times vserver experienced spill over.", "config": {"oid": "1.3.6.1.4.1.5951.4.1.3.1.1.54.##WILDVALUE##"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "BPS_for_VIP", "title": "BPS for VIP ##INSTANCE##", "verticalLabel": "bps", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "RequestBytes", "datapointName": "RequestBytes", "consolidationFn": "max"}, {"name": "ResponseBytes", "datapointName": "ResponseBytes", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "RequestBPS", "expr": "RequestBytes*8"}, {"name": "ResponseBPS", "expr": "ResponseBytes*8"}], "lines": [{"type": "line", "legend": "Request", "color": "green", "datapointName": "RequestBPS", "isVirtual": true}, {"type": "line", "legend": "Response", "color": "blue", "datapointName": "ResponseBPS", "isVirtual": true}]}, {"name": "Connections", "title": "Connections for ##INSTANCE##", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "vsvrCurClntConnections", "datapointName": "ClientConnections", "consolidationFn": "average"}, {"name": "vsvrCurSrvrConnections", "datapointName": "ServerConnections", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Client Connections", "color": "blue", "datapointName": "vsvrCurClntConnections", "isVirtual": false}, {"type": "line", "legend": "Server Connections", "color": "olive", "datapointName": "vsvrCurSrvrConnections", "isVirtual": false}]}, {"name": "Health", "title": "Health", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Health", "datapointName": "Health", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Health", "color": "silver", "datapointName": "Health", "isVirtual": false}]}, {"name": "ReponseTime", "title": "Time to First Byte for ##INSTANCE##", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "TTFB", "datapointName": "AvgTimeToFirstByte", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Time to First Byte", "color": "blue", "datapointName": "TTFB", "isVirtual": false}]}, {"name": "Requests", "title": "Requests for ##INSTANCE##", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 40, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Requests", "datapointName": "Requests", "consolidationFn": "average"}, {"name": "Responses", "datapointName": "Responses", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Requests per second", "color": "blue", "datapointName": "Requests", "isVirtual": false}, {"type": "line", "legend": "Responses per second", "color": "olive", "datapointName": "Responses", "isVirtual": false}]}, {"name": "SYN Flood Packet Rate", "title": "SynFloodRate", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SynfloodRate", "datapointName": "SynfloodRate", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Packets", "color": "silver", "datapointName": "SynfloodRate", "isVirtual": false}]}, {"name": "Server Hits", "title": "Server Hits", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "TotHits", "datapointName": "TotHits", "consolidationFn": "average"}, {"name": "TotMiss", "datapointName": "TotMiss", "consolidationFn": "average"}, {"name": "TotSpillOvers", "datapointName": "TotSpillOvers", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Hits", "color": "silver", "datapointName": "TotHits", "isVirtual": false}, {"type": "line", "legend": "Miss", "color": "green", "datapointName": "TotMiss", "isVirtual": false}, {"type": "line", "legend": "Spillovers", "color": "silver", "datapointName": "TotSpillOvers", "isVirtual": false}]}, {"name": "Services", "title": "Backend services for ##INSTANCE##", "verticalLabel": "count", "min": 0.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Down", "datapointName": "ServicesDown", "consolidationFn": "max"}, {"name": "OutofService", "datapointName": "ServicesOutOfSvc", "consolidationFn": "max"}, {"name": "Total", "datapointName": "ServicesTotal", "consolidationFn": "average"}, {"name": "TransOutOfService", "datapointName": "ServicesTransToOutOfSvc", "consolidationFn": "average"}, {"name": "Up", "datapointName": "ServicesUp", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Down", "color": "red", "datapointName": "Down", "isVirtual": false}, {"type": "stack", "legend": "Out of Service", "color": "blue", "datapointName": "OutofService", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "silver", "datapointName": "Total", "isVirtual": false}, {"type": "line", "legend": "Transitioning", "color": "yellow", "datapointName": "TransOutOfService", "isVirtual": false}, {"type": "stack", "legend": "Total", "color": "green", "datapointName": "Up", "isVirtual": false}]}, {"name": "State", "title": "State", "verticalLabel": "status code", "min": 0.0, "max": 8.0, "displayPriority": 60, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "State", "datapointName": "State", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "State: 1 down, 2 unknown, 3 busy, 4 outOfService", "color": "blue", "datapointName": "State", "isVirtual": false}]}, {"name": "Surge_Queue", "title": "Surge Queue", "verticalLabel": "count", "min": 0.0, "displayPriority": 70, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SurgeCount", "datapointName": "SurgeCount", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Surge Count", "color": "red", "datapointName": "SurgeCount", "isVirtual": false}]}], "overviewGraphs": [{"name": "Client_Connections_Overview", "title": "Client Connections Overview", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": true, "datapoints": [{"name": "vsvrCurClntConnections", "datapointName": "ClientConnections", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "Auto", "datapointName": "vsvrCurClntConnections", "isVirtual": false}]}, {"name": "Requests_Overview", "title": "Requests Overview", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": true, "datapoints": [{"name": "vsvrTotalRequests", "datapointName": "Requests", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "Auto", "datapointName": "vsvrTotalRequests", "isVirtual": false}]}, {"name": "Surge_Queue", "title": "Surge Queue", "verticalLabel": "count", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "SurgeCount", "datapointName": "SurgeCount", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "Auto", "datapointName": "SurgeCount", "isVirtual": false}]}]}

×DataSource: UNC Monitor- (1070)

{"name": "UNC Monitor-", "description": "Monitors the accessibility of a UNC path from an agent. May be a directory or file path.", "appliesTo": "isWindows()", "searchKeywords": "windows unc", "technicalNotes": "Add an instance manually in form \\\\hostname\\path (e.g. \\\\server1\\c$)\n\nNOTES:\n- win.user and win.pass can also be used as host properties for folders where authentication is required.\n- Add unc.recursive property on the instance to make it recursive. Can be set to anything\n- Warning: Potentially large CPU use and execution time for large folders if the recursive flag is set.", "displayedAs": "UNC Monitor", "collectionInterval": "1m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": false, "discoveryMethod": "", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef user = hostProps.get(\"win.user\")\ndef pass = hostProps.get(\"win.pass\")\ndef isWindows = hostProps.get(\"system.collectorplatform\").toLowerCase() =~ \"windows\"\n\nif (!isWindows) {\n println \"Non-Windows collector detected, please run on a Windows collector\"\n return 1\n}\n\ndef path = instanceProps.get(\"wildvalue\")\ndef isRecursive = instanceProps.get(\"unc.recursive\")\n\ndef userString = user ? \"net use ${path} /user:${user} ${pass} & \" : \"\"\n\ndef success = true\ntry {\n def command = \"cmd /c ${userString} dir \\\"${path}\\\" /a ${isRecursive ? \"/s\" : \"\"} | findstr \\\"File(s) Dir(s)\\\"\";\n\n def stdout = command.execute().text;\n def result = stdout.readLines();\n println result\n\n def fileInfo = result[-2];\n def dirInfo = result[-1];\n\n def tokens = fileInfo.split();\n\n println(\"Files=${tokens[0]}\");\n println(\"UsedSpace=${tokens[2].replace(',', '')}\");\n\n tokens = dirInfo.split();\n\n println(\"Folders=${tokens[0]}\");\n println(\"FreeSpace=${tokens[2].replace(',', '')}\");\n} catch (Exception e) {\n\n\n println e\n\n success = false\n}\n\nreturn success ? 0 : 1;"}, "datapoints": [{"name": "BytesInDir", "description": "The number of bytes in the UNC filepath. If the recursive flag is set, this includes all sub-directories.", "interpretMethod": "namevalue", "interpretExpr": "UsedSpace", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "BytesInVolFree", "description": "The number of bytes remaining in UNC path volume.", "interpretMethod": "namevalue", "interpretExpr": "FreeSpace", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ExitStatus", "description": "0=OK 1=Error", "interpretMethod": "none", "useValue": "exitCode", "type": "gauge", "dataType": 4, "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Found", "description": "Returns 1 if the string \"bytes free\" is found (that string will be returned on successful directory listing.)", "interpretMethod": "textmatch", "interpretExpr": "bytes free", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "NumFiles", "description": "Total file count in the directory. If recursive flag is set, this includes files in sub-directories.", "interpretMethod": "namevalue", "interpretExpr": "Files", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "NumFolders", "description": "Total folder count in the directory. If recursive flag is set, this includes sub-directories.", "interpretMethod": "namevalue", "interpretExpr": "Folders", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ResponseTime", "description": "Response time, in milliseconds.", "interpretMethod": "none", "useValue": "responseTime", "type": "gauge", "dataType": 4, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Found Status", "title": "Found Status", "verticalLabel": "0=not found, 1=found", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Found", "datapointName": "Found", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Found", "color": "blue", "datapointName": "Found", "isVirtual": false}]}, {"name": "Free Space in UNC Directory", "title": "Free Space in UNC Directory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "BytesInVolFree", "datapointName": "BytesInVolFree", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Free", "color": "green", "datapointName": "BytesInVolFree", "isVirtual": false}]}, {"name": "Number of Files", "title": "Number of Files", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "NumFiles", "datapointName": "NumFiles", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Files", "color": "blue", "datapointName": "NumFiles", "isVirtual": false}]}, {"name": "Number of Folders", "title": "Number of Folders", "verticalLabel": "count", "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "NumFolders", "datapointName": "NumFolders", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Folders", "color": "purple", "datapointName": "NumFolders", "isVirtual": false}]}, {"name": "Response Time", "title": "Response Time", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ResponseTime", "datapointName": "ResponseTime", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Response Time", "color": "blue", "datapointName": "ResponseTime", "isVirtual": false}]}, {"name": "UNC Directory Path Status", "title": "UNC Directory Path Status", "verticalLabel": "status code", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "ExitStatus", "datapointName": "ExitStatus", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Path Status", "color": "red", "datapointName": "ExitStatus", "isVirtual": false}]}, {"name": "UNC Directory Usage", "title": "UNC Directory Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "BytesInDir", "datapointName": "BytesInDir", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Size", "color": "red", "datapointName": "BytesInDir", "isVirtual": false}]}]}

×DataSource: APC_Environment_Monitor_Humidity- (1007)

{"name": "APC_Environment_Monitor_Humidity-", "description": "APC environmental monitor for humidity.", "appliesTo": "hasCategory(\"APC\")", "searchKeywords": "environmental,apc,humidity,sensor,hardware", "displayedAs": "APC Environment Monitor Humidity-", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_snmp", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"discoveryType": "value", "oid": ".1.3.6.1.4.1.318.1.1.10.3.13.1.1.2"}, "filters": [{"attr": ".1.3.6.1.4.1.318.1.1.10.3.13.1.1.6", "op": "GreaterEqual", "value": "0", "comment": "Check that a real value is being reported"}], "groupMethod": "none"}, "datapoints": [{"name": "HighHumidityThresh", "description": "Probe high humidity threshold.", "config": {"oid": ".1.3.6.1.4.1.318.1.1.10.3.13.1.1.7.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HighHumidityThreshBreach", "description": "Returns the probe humidity value if the probed humidity is above the high humidity threshold level. Otherwise returns zero.", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(ge(ProbeHumidity,HighHumidityThresh),ProbeHumidity,0)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The humidity sensor ##INSTANCE## ##DSIDESCRIPTION## on ##HOST## has breached the high humidity threshold set on the resource placing it in ##LEVEL## level. The reported humidity is now ##VALUE## percent.This started at ##START## or ##DURATION## ago. Please investigate."}, {"name": "LowHumidityThresh", "description": "Probe low humidity threshold.", "config": {"oid": ".1.3.6.1.4.1.318.1.1.10.3.13.1.1.8.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "LowHumidityThreshBreach", "description": "Returns the probe humidity value if the probed humidity is below the low humidity threshold level. Otherwise returns one hundred.", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(le(ProbeHumidity,LowHumidityThresh),ProbeHumidity,100)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "< 100 100", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The humidity sensor ##INSTANCE## ##DSIDESCRIPTION## on ##HOST## has breached the low humidity threshold set on the resource placing it in ##LEVEL## level. The reported humidity is now ##VALUE## percent. This started at ##START## or ##DURATION## ago. Please investigate"}, {"name": "ProbeHumidity", "description": "Probe humidity reading.", "config": {"oid": ".1.3.6.1.4.1.318.1.1.10.3.13.1.1.6.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}], "graphs": [{"name": "Humidity", "title": "Humidity", "verticalLabel": "%", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "HighHumidityThresh", "datapointName": "HighHumidityThresh", "consolidationFn": "average"}, {"name": "Humidity", "datapointName": "ProbeHumidity", "consolidationFn": "average"}, {"name": "LowHumidityThresh", "datapointName": "LowHumidityThresh", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "High Humidity Threshold", "color": "red", "datapointName": "HighHumidityThresh", "isVirtual": false}, {"type": "line", "legend": "Humidity", "color": "green", "datapointName": "Humidity", "isVirtual": false}, {"type": "line", "legend": "Low Humidity Threshold", "color": "blue", "datapointName": "LowHumidityThresh", "isVirtual": false}]}]}

×DataSource: APC_Environment_Monitor_Temp- (2055)

{"name": "APC_Environment_Monitor_Temp-", "description": "Monitor temperature sensors. Celsius or Fahrenheit is dependant on APC system preferences", "appliesTo": "hasCategory(\"APC\")", "searchKeywords": "environmental,apc,temperature,sensor,hardware", "displayedAs": "APC Environment Monitor Temp-", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_snmp", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"discoveryType": "value", "oid": ".1.3.6.1.4.1.318.1.1.10.3.13.1.1.2"}, "filters": [{"attr": ".1.3.6.1.4.1.318.1.1.10.3.13.1.1.3", "op": "GreaterThan", "value": "0", "comment": "Check that a real value is being reported"}], "groupMethod": "none"}, "datapoints": [{"name": "HighTempThresh", "description": "Probe high temperature threshold.", "config": {"oid": ".1.3.6.1.4.1.318.1.1.10.3.13.1.1.4.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HighTempThresholdBreach", "description": "Returns 1 if the temperature is above devices threshold", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(ge(ProbeTemperature,HighTempThresh),ProbeTemperature,0)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The temperature sensor ##INSTANCE## ##DSIDESCRIPTION## on ##HOST## has breached the high temperature threshold set on the device. The reported temperature is now ##VALUE## degrees. This started at ##START## or ##DURATION## ago. Please investigate."}, {"name": "LowTempThresh", "description": "Probe low temperature threshold.", "config": {"oid": ".1.3.6.1.4.1.318.1.1.10.3.13.1.1.5.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "LowTempThreshBreach", "description": "Returns 1 if the temperature is below devices threshold", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(le(ProbeTemperature,LowTempThresh),ProbeTemperature,100)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "< 100 100", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The temperature sensor ##INSTANCE## ##DSIDESCRIPTION## on ##HOST## has breached the low temperature threshold set on the device. The reported temperature is now ##VALUE## degrees.This started at ##START## or ##DURATION## ago. Please investigate."}, {"name": "ProbeTemperature", "description": "Probe temperature reading", "config": {"oid": ".1.3.6.1.4.1.318.1.1.10.3.13.1.1.3.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}], "graphs": [{"name": "Temperature", "title": "Temperature", "verticalLabel": "Temperature", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "HighTempThresh", "datapointName": "HighTempThresh", "consolidationFn": "average"}, {"name": "LowTempThresh", "datapointName": "LowTempThresh", "consolidationFn": "average"}, {"name": "Temperature", "datapointName": "ProbeTemperature", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "High Temp Threshold", "color": "red", "datapointName": "HighTempThresh", "isVirtual": false}, {"type": "line", "legend": "Low Temp Threshold", "color": "blue", "datapointName": "LowTempThresh", "isVirtual": false}, {"type": "line", "legend": "Temperature", "color": "green", "datapointName": "Temperature", "isVirtual": false}]}]}

×DataSource: Isilon Fans- (2283)

{"name": "Isilon Fans-", "description": "Monitors fans in the node including expansion chassis.", "appliesTo": "hasCategory(\"Isilon\")", "searchKeywords": "fan,emc,storage,isilon", "displayedAs": "Node Fans-", "collectionInterval": "5m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_snmp", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"discoveryType": "value", "oid": ".1.3.6.1.4.1.12124.2.53.1.2", "descriptionOid": ".1.3.6.1.4.1.12124.2.53.1.3"}, "groupMethod": "none"}, "datapoints": [{"name": "fanSpeed", "description": "The current speed of the fan in revolutions per minute.", "config": {"oid": ".1.3.6.1.4.1.12124.2.53.1.4.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "threshold": "< 5", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Fan speed on ##HOST## is low (##VALUE##).\nThis started at ##START## and has a duration of ##DURATION##."}], "graphs": [{"name": "Fan Sensor", "title": "Fan Sensor", "verticalLabel": "Revolutions per minute", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "speed", "datapointName": "fanSpeed", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "speed", "color": "blue", "datapointName": "speed", "isVirtual": false}]}]}

×DataSource: Isilon Node Network Performance (2281)

{"name": "Isilon Node Network Performance", "description": "Network throughput for this node", "appliesTo": "hasCategory(\"Isilon\")", "searchKeywords": "emc,storage,isilon", "displayedAs": "Node Network Performance", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\ndef hostname = hostProps.get(\"system.hostname\");\n\ndef snmpGetWithRetry(hostname, oid)\n{\n \tfor(int i = 0; i < 3; i++)\n \t{\n\t \ttry\n\t\t{\n\t\t\tvalue = Snmp.get(hostname, oid);\n\t\t\treturn value;\n\t\t} \n\t\tcatch (Exception ex){println(ex)}\n\t}\n \treturn null;\n}\n\n// The total values return a constant 0, so per second must be used\n\nprintln(\"nodeNetworkInBitsPerSecond=\" + snmpGetWithRetry(hostname,\".1.3.6.1.4.1.12124.2.2.2.2.0\"));\nprintln(\"nodeNetworkOutBitsPerSecond=\" + snmpGetWithRetry(hostname,\".1.3.6.1.4.1.12124.2.2.2.4.0\"));"}, "datapoints": [{"name": "nodeNetworkInBitsPerSecond", "description": "The total input rate (bits per second) into the\nnode's external interfaces.", "interpretMethod": "namevalue", "interpretExpr": "nodeNetworkInBitsPerSecond", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "nodeNetworkOutBitsPerSecond", "description": "The total output rate (bits per second) from the\nnode's external interfaces.", "interpretMethod": "namevalue", "interpretExpr": "nodeNetworkOutBitsPerSecond", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}], "graphs": [{"name": "Bits Per Second", "title": "BitsPer Second", "verticalLabel": "Bits/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "clusterNetworkInBitsPerSecond", "datapointName": "nodeNetworkInBitsPerSecond", "consolidationFn": "average"}, {"name": "clusterNetworkOutBitsPerSecond", "datapointName": "nodeNetworkOutBitsPerSecond", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "In Average", "color": "blue", "datapointName": "clusterNetworkInBitsPerSecond", "isVirtual": false}, {"type": "line", "legend": "Out Average", "color": "green", "datapointName": "clusterNetworkOutBitsPerSecond", "isVirtual": false}]}]}

×DataSource: Isilon Node Protocol Performance- (2279)

{"name": "Isilon Node Protocol Performance-", "description": "Per-protocol performance metrics and statistics for this node.", "appliesTo": "hasCategory(\"Isilon\")", "searchKeywords": "emc,storage,isilon", "displayedAs": "Node Protocol Performance-", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_snmp", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"discoveryType": "value", "oid": ".1.3.6.1.4.1.12124.2.2.10.1.1"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "//The InBitsPerSecond and OutBitsPerSecond OIDS will not return using the standard SNMP collector datasource, as they are of type CounterBasedGauge64, which is not currently supported.\n\nimport com.santaba.agent.groovyapi.snmp.Snmp;\n\ndef hostname = hostProps.get(\"system.hostname\");\ndef wildvalue = \"##WILDVALUE##\";\n\nprintln(\"InBitsPerSecond=\" + Snmp.get(hostname, \".1.3.6.1.4.1.12124.2.2.10.1.8.\" + wildvalue));\nprintln(\"OpsPerSecond=\" + Snmp.get(hostname, \".1.3.6.1.4.1.12124.2.2.10.1.3.\" + wildvalue));\nprintln(\"OutBitsPerSecond=\" + Snmp.get(hostname, \".1.3.6.1.4.1.12124.2.2.10.1.13.\" + wildvalue));\nprintln(\"LatencyMin=\" + Snmp.get(hostname, \".1.3.6.1.4.1.12124.2.2.10.1.14.\" + wildvalue).toInteger()/1000);\nprintln(\"LatencyMax=\" + Snmp.get(hostname, \".1.3.6.1.4.1.12124.2.2.10.1.15.\" + wildvalue).toInteger()/1000);\nprintln(\"LatencyAverage=\" + Snmp.get(hostname, \".1.3.6.1.4.1.12124.2.2.10.1.16.\" + wildvalue).toInteger()/1000);\n\nreturn 0;"}, "datapoints": [{"name": "InBitsPerSecond", "description": "The input rate (bits per second) for the protocol.", "interpretMethod": "namevalue", "interpretExpr": "InBitsPerSecond", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "LatencyAverage", "description": "The average latency in microseconds\nfor all operations for the protocol.", "interpretMethod": "namevalue", "interpretExpr": "LatencyAverage", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "LatencyMax", "description": "The maximum latency in microseconds\nfor all operations for the protocol.", "interpretMethod": "namevalue", "interpretExpr": "LatencyMax", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "LatencyMin", "description": "The minimum latency in microseconds\nfor all operations for the protocol.", "interpretMethod": "namevalue", "interpretExpr": "LatencyMin", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "OpsPerSecond", "description": "The number of operations per second.", "interpretMethod": "namevalue", "interpretExpr": "OpsPerSecond", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "OutBitsPerSecond", "description": "The output rate (bits per second)\nfor all operations for the protocol.", "interpretMethod": "namevalue", "interpretExpr": "OutBitsPerSecond", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}], "graphs": [{"name": "IO Bytes", "title": "IO Bytes for ##INSTANCE## ##DESCRIPTION##", "verticalLabel": "Bytes/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "InBitsPerSecond", "datapointName": "InBitsPerSecond", "consolidationFn": "average"}, {"name": "OutBitsPerSecond", "datapointName": "OutBitsPerSecond", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "InBytesPerSecond", "expr": "InBitsPerSecond/8"}, {"name": "OutBytesPerSecond", "expr": "OutBitsPerSecond/8"}], "lines": [{"type": "line", "legend": "Read", "color": "blue", "datapointName": "InBytesPerSecond", "isVirtual": true}, {"type": "line", "legend": "Written", "color": "green", "datapointName": "OutBytesPerSecond", "isVirtual": true}]}, {"name": "Latency", "title": "Latency", "verticalLabel": "Milliseconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "LatencyAverage", "datapointName": "LatencyAverage", "consolidationFn": "average"}, {"name": "LatencyMax", "datapointName": "LatencyMax", "consolidationFn": "max"}, {"name": "LatencyMin", "datapointName": "LatencyMin", "consolidationFn": "min"}], "lines": [{"type": "line", "legend": "LatencyAverage", "color": "orange", "datapointName": "LatencyAverage", "isVirtual": false}, {"type": "line", "legend": "LatencyMax", "color": "red", "datapointName": "LatencyMax", "isVirtual": false}, {"type": "line", "legend": "LatencyMin", "color": "yellow", "datapointName": "LatencyMin", "isVirtual": false}]}, {"name": "Operations Per Second", "title": "Operations for ##INSTANCE## ##DESCRIPTION##", "verticalLabel": "#", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "OpsPerSecond", "datapointName": "OpsPerSecond", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Operations", "color": "blue", "datapointName": "OpsPerSecond", "isVirtual": false}]}], "overviewGraphs": [{"name": "Operations Per Second", "title": "Operations Per Second", "verticalLabel": "Operation Count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": true, "datapoints": [{"name": "OpsPerSecond", "datapointName": "OpsPerSecond", "consolidationFn": "average", "aggregateMethod": "SUM"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "blue", "datapointName": "OpsPerSecond", "isVirtual": false}]}]}

×DataSource: Isilon Temp Sensor- (2275)

{"name": "Isilon Temp Sensor-", "description": "Monitors thermal sensors in the node including expansion chassis.", "appliesTo": "hasCategory(\"Isilon\")", "searchKeywords": "temperature,emc,storage,isilon", "displayedAs": "Node Temperature Sensor-", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_snmp", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"discoveryType": "value", "oid": ".1.3.6.1.4.1.12124.2.54.1.2", "descriptionOid": ".1.3.6.1.4.1.12124.2.54.1.3"}, "filters": [{"attr": ".1.3.6.1.4.1.12124.2.54.1.3", "op": "NotContain", "value": "Throttle", "comment": "Don't include throttle"}], "groupMethod": "none"}, "datapoints": [{"name": "tempSensorValue", "description": "The current reading of the temperature sensor in degrees celsius.", "config": {"oid": ".1.3.6.1.4.1.12124.2.54.1.4.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 40 50", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "##HOST## is in danger of overheating with a temperature of ##VALUE## on sensor ##INSTANCE## ##DSIDESCRIPTION##. This began at ##START## and has been going on for ##DURATION##"}], "graphs": [{"name": "Temperature Sensor", "title": "Temperature Sensor", "verticalLabel": "C", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "temp", "datapointName": "tempSensorValue", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Temperature", "color": "red", "datapointName": "temp", "isVirtual": false}]}], "overviewGraphs": [{"name": "Temperature Overview", "title": "Temperature Overview", "verticalLabel": "C", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": true, "datapoints": [{"name": "tempSensorValue", "datapointName": "tempSensorValue", "consolidationFn": "average", "aggregateMethod": "average"}], "lines": [{"type": "line", "legend": "##INSTANCE## - ##DSIDESCRIPTION##", "color": "blue", "datapointName": "tempSensorValue", "isVirtual": false}]}]}

×DataSource: Isilon Temp Throttle Sensor- (2274)

{"name": "Isilon Temp Throttle Sensor-", "description": "Monitors thermal throttle sensors in the node including expansion chassis.", "appliesTo": "hasCategory(\"Isilon\")", "searchKeywords": "temperature,emc,storage,isilon", "displayedAs": "Node Temperature Throttle Sensor-", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_snmp", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"discoveryType": "value", "oid": ".1.3.6.1.4.1.12124.2.54.1.2", "descriptionOid": ".1.3.6.1.4.1.12124.2.54.1.3"}, "filters": [{"attr": ".1.3.6.1.4.1.12124.2.54.1.3", "op": "Contain", "value": "Throttle", "comment": "Only include throttle sensors."}], "groupMethod": "none"}, "datapoints": [{"name": "tempSensorValue", "description": "The current reading of the temperature sensor in degrees celsius.", "config": {"oid": ".1.3.6.1.4.1.12124.2.54.1.4.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "##HOST## is in danger of overheating with a temperature of ##VALUE##. This began at ##START## and has been going on for ##DURATION##"}], "graphs": [{"name": "Temperature Sensor", "title": "Temperature Sensor", "verticalLabel": "C", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "temp", "datapointName": "tempSensorValue", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Temperature", "color": "red", "datapointName": "temp", "isVirtual": false}]}], "overviewGraphs": [{"name": "Temperature Overview", "title": "Temperature Overview", "verticalLabel": "C", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": true, "datapoints": [{"name": "tempSensorValue", "datapointName": "tempSensorValue", "consolidationFn": "average", "aggregateMethod": "average"}], "lines": [{"type": "line", "legend": "##INSTANCE## - ##DSIDESCRIPTION##", "color": "blue", "datapointName": "tempSensorValue", "isVirtual": false}]}]}

×DataSource: Nimble Volume Usage (709)

{"name": "Nimble Volume Usage", "description": "Nimble volume usage via SNMP.", "appliesTo": "hasCategory(\"NimbleStorage\")", "searchKeywords": "volume,nimble,storage", "technicalNotes": "SNMP must be enabled on your array for this datasource to collect data.", "displayedAs": "Volume Usage", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get('system.hostname')\ndef props = hostProps.toProperties()\ndef timeout = 10000\n\n/*\nThe following SNMP walk will handle v1 , v2 and v3.\nProps contains a map of ALL host properties and the SNMP walk method will automatically\nhandle the proper connection based on which SNMP version is configured.\n*/\ndef volumes = Snmp.walkAsMap(hostname, '.1.3.6.1.4.1.37447.1.2.1.3', props, timeout)\n\nvolumes.each{index, name ->\n\tprintln \"${index}##${name}######\"\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get('system.hostname')\ndef props = hostProps.toProperties()\ndef timeout = 10000\n\n/*\nThe following SNMP walk will handle v1 , v2 and v3.\nProps contains a map of ALL host properties and the SNMP walk method will automatically\nhandle the proper connection based on which SNMP version is configured.\n*/\ndef volume_data =[\n 'numConnections': Snmp.walkAsMap(hostname, '.1.3.6.1.4.1.37447.1.2.1.11', props, timeout),\n 'sizeHigh': Snmp.walkAsMap(hostname, '.1.3.6.1.4.1.37447.1.2.1.5', props, timeout),\n 'sizeLow': Snmp.walkAsMap(hostname, '.1.3.6.1.4.1.37447.1.2.1.4', props, timeout),\n 'usageHigh': Snmp.walkAsMap(hostname, '.1.3.6.1.4.1.37447.1.2.1.7', props, timeout),\n 'usageLow': Snmp.walkAsMap(hostname, '.1.3.6.1.4.1.37447.1.2.1.6', props, timeout)\n]\n\nvolume_data.each{metric, raw_data ->\n raw_data.each{wildvalue, data ->\n println \"${wildvalue}.${metric}=${data}\"\n }\n}\n\nreturn 0"}, "datapoints": [{"name": "PercentUsed", "description": "Percentage of the volume space that has been used.", "interpretMethod": "expression", "interpretExpr": "VolUsageGBytes/VolSizeGBytes*100", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 85 95", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 2, "alertBody": "The volume ##INSTANCE## ##DSIDESCRIPTION## on ##HOST## is in ##LEVEL## as it is now ##VALUE## % full.\n\nThis has been ongoing since ##START## or for ##DURATION##."}, {"name": "VolSizeGBytes", "description": "Size of volume in bytes", "interpretMethod": "expression", "interpretExpr": "(if(lt(volSizeLow,0),4294967296+volSizeLow,volSizeLow)+(volSizeHigh*4294967296))/1024", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "VolUsageGBytes", "description": "Space used in bytes", "interpretMethod": "expression", "interpretExpr": "(if(lt(volUsageLow,0),4294967296+volUsageLow,volUsageLow)+(volUsageHigh*4294967296))/1024", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "volNumConnections", "description": "Number of connections to the volume.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.numConnections", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "volSizeHigh", "description": "Max. size in Mbytes (high order bytes).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sizeHigh", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "volSizeLow", "description": "Max. size in Mbytes (low order bytes).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sizeLow", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "volUsageHigh", "description": "Usage size in Mbytes (high order bytes).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.usageHigh", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "volUsageLow", "description": "Usage size in Mbytes (low order bytes).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.usageLow", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Volume Usage", "title": "Volume Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": true, "datapoints": [{"name": "VolSizeGBytes", "datapointName": "VolSizeGBytes", "consolidationFn": "average"}, {"name": "VolUsageGBytes", "datapointName": "VolUsageGBytes", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "VolSizeBytes", "expr": "VolSizeGBytes * 1024 * 1024 * 1024"}, {"name": "VolUsageBytes", "expr": "VolUsageGBytes * 1024 * 1024 * 1024"}], "lines": [{"type": "line", "legend": "TotalSize", "color": "black", "datapointName": "VolSizeBytes", "isVirtual": true}, {"type": "area", "legend": "TotalUsage", "color": "fuchsia", "datapointName": "VolUsageBytes", "isVirtual": true}]}, {"name": "iSCSI connections", "title": "iSCSI connections", "verticalLabel": "connection count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "volNumConnections", "datapointName": "volNumConnections", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "connections", "color": "blue", "datapointName": "volNumConnections", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top Ten Volumes by Connection Count", "title": "Top Ten Volumes by Connection Count", "verticalLabel": "connection count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": true, "datapoints": [{"name": "connections", "datapointName": "volNumConnections", "consolidationFn": "average", "aggregateMethod": "average"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "connections", "isVirtual": false}]}, {"name": "Top Ten Volumes by Usage", "title": "Top Ten Volumes by Usage", "verticalLabel": "%", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": true, "datapoints": [{"name": "PercentUsed", "datapointName": "PercentUsed", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "blue", "datapointName": "PercentUsed", "isVirtual": false}]}]}

×DataSource: AWS_RDS (831)

{"name": "AWS_RDS", "description": "Gathers Relational Database Service performance data as reported by CloudWatch. Per Amazon, minimum polling interval is 1m.", "appliesTo": "hasCategory(\"AWS/RDS\") && system.aws.engine != \"neptune\" && system.aws.engine != \"aurora\"", "searchKeywords": "cloud,amazon,rds,database,aws", "displayedAs": "RDS", "collectionInterval": "2m", "collectionMethod": "awscloudwatch", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "BinLogDiskUsage", "description": "The amount of disk space (in Bytes) occupied by binary logs on the master. Applies to MySQL read replicas.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>BinLogDiskUsage>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "BurstBalance", "description": "The percent of General Purpose SSD (gp2) burst-bucket I/O credits available.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>BurstBalance>Average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BurstBalanceNormalized", "description": "BurstBalance with \"No Data\" values set to 0", "interpretMethod": "expression", "interpretExpr": "if(un(BurstBalance),0,BurstBalance)", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "> 80 95", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "The BurstBalance on ##HOST## is now at ##VALUE## percent utilization, putting it in a state of ##LEVEL##. \n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "CPUUtilization", "description": "The percentage of CPU utilization.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>CPUUtilization>Average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 80 95", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "The CPU on ##HOST## is now at ##VALUE## percent utilization, putting it in a state of ##LEVEL##. \n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "DatabaseConnections", "description": "The number of database connections in use.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>DatabaseConnections>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "DiskQueueDepth", "description": "The number of outstanding IOs (read/write requests) waiting to access the disk.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>DiskQueueDepth>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "FreeStorageSpace", "description": "The amount of available storage space in bytes.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>FreeStorageSpace>Average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "FreeableMemory", "description": "The amount of available random access memory.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>FreeableMemory>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "NetworkReceiveThroughput", "description": "The incoming (Receive) network traffic on the DB instance in Bytes/second, including both customer database traffic and Amazon RDS traffic used for monitoring and replication.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>NetworkReceiveThroughput>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "NetworkReceivebps", "description": "incoming network traffic on the DB instance", "interpretMethod": "expression", "interpretExpr": "NetworkReceiveThroughput*8/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "NetworkTransmitThroughput", "description": "The outgoing (Transmit) network traffic on the DB instance in Bytes/second, including both customer database traffic and Amazon RDS traffic used for monitoring and replication.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>NetworkTransmitThroughput>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "NetworkTransmitbps", "description": "transmitted network traffic", "interpretMethod": "expression", "interpretExpr": "NetworkTransmitThroughput*8/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ReadIOPS", "description": "read disk I/O operations per second.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>ReadIOPS>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ReadLatency", "description": "The average amount of time (in seconds) taken per read disk I/O operation.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>ReadLatency>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ReadLatencyms", "description": "Disk Read Latency in ms", "interpretMethod": "expression", "interpretExpr": "ReadLatency*1000", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ReadThroughput", "description": "The average number of bytes read from disk per second.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>ReadThroughput>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ReplicaLag", "description": "The amount of time a Read Replica DB Instance lags behind the source DB Instance. Applies to MySQL read replicas. A replica lag of -1 means that the slave is unable to catch up with the master in that period.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>ReplicaLag>Average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "-1", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ReplicaLagNormalized", "description": "ReplicaLag with \"No Data\" converted to 0", "interpretMethod": "expression", "interpretExpr": "if(un(ReplicaLag),0,ReplicaLag)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SwapUsage", "description": "The amount of swap space (in Bytes) used on the DB Instance.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>SwapUsage>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "WriteIOPS", "description": "Write disk I/O operations per second.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>WriteIOPS>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "WriteLatency", "description": "The average amount of time (in seconds) taken per write disk I/O operation.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>WriteLatency>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "WriteLatencyms", "description": "Disk Write Latency in ms", "interpretMethod": "expression", "interpretExpr": "WriteLatency*1000", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WriteThroughput", "description": "The average number of bytes written to disk per second.", "interpretMethod": "none", "interpretExpr": "AWS/RDS>DBInstanceIdentifier:##system.aws.resourceid##>WriteThroughput>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "percentStorageUsed", "description": "The percentage of allocated RDS storage space currently used.", "interpretMethod": "expression", "interpretExpr": "((##system.aws.allocatedStorage## - (FreeStorageSpace/ 1073741824))/##system.aws.allocatedStorage##)*100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "> 85 95", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The percent of used storage on ##HOSTNAME## is being reported as ##VALUE## placing it in ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "BinaryDiskUsage", "title": "Binlog Disk Usage on Master", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": true, "rigid": true, "datapoints": [{"name": "BinLogDiskUsage", "datapointName": "BinLogDiskUsage", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "BinLog Size", "color": "black", "datapointName": "BinLogDiskUsage", "isVirtual": false}]}, {"name": "Burst Balance", "title": "Burst Balance", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BurstBalanceNormalized", "datapointName": "BurstBalanceNormalized", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "BurstBalanceNormalized", "color": "silver", "datapointName": "BurstBalanceNormalized", "isVirtual": false}]}, {"name": "CPU Utilization", "title": "CPU Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "CPUUtilization", "datapointName": "CPUUtilization", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "CPU", "color": "purple", "datapointName": "CPUUtilization", "isVirtual": false}]}, {"name": "Database Connections", "title": "Database Connections", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "DatabaseConnections", "datapointName": "DatabaseConnections", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Connections", "color": "blue", "datapointName": "DatabaseConnections", "isVirtual": false}]}, {"name": "Disk Latency", "title": "Disk Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "ReadLatency", "datapointName": "ReadLatencyms", "consolidationFn": "average"}, {"name": "WriteLatency", "datapointName": "WriteLatencyms", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Reads", "color": "green", "datapointName": "ReadLatency", "isVirtual": false}, {"type": "line", "legend": "Writes", "color": "orange", "datapointName": "WriteLatency", "isVirtual": false}]}, {"name": "Disk Operations", "title": "Disk Operations", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "ReadIOPS", "datapointName": "ReadIOPS", "consolidationFn": "average"}, {"name": "WriteIOPS", "datapointName": "WriteIOPS", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Read", "color": "blue", "datapointName": "ReadIOPS", "isVirtual": false}, {"type": "line", "legend": "Write", "color": "aqua", "datapointName": "WriteIOPS", "isVirtual": false}]}, {"name": "Disk Queue", "title": "Disk Queue", "verticalLabel": "count", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "DiskQueueDepth", "datapointName": "DiskQueueDepth", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Queued Operations", "color": "orange", "datapointName": "DiskQueueDepth", "isVirtual": false}]}, {"name": "Disk Throughput", "title": "Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "ReadThroughput", "datapointName": "ReadThroughput", "consolidationFn": "average"}, {"name": "WriteThroughput", "datapointName": "WriteThroughput", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Read", "color": "blue", "datapointName": "ReadThroughput", "isVirtual": false}, {"type": "line", "legend": "Write", "color": "green", "datapointName": "WriteThroughput", "isVirtual": false}]}, {"name": "Free Disk Space", "title": "Free Disk Space", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": true, "datapoints": [{"name": "FreeStorageSpace", "datapointName": "FreeStorageSpace", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Free Space", "color": "olive", "datapointName": "FreeStorageSpace", "isVirtual": false}]}, {"name": "Memory", "title": "Free Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": true, "datapoints": [{"name": "FreeableMemory", "datapointName": "FreeableMemory", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Free", "color": "green", "datapointName": "FreeableMemory", "isVirtual": false}]}, {"name": "Network Throughput", "title": "Network Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "NetworkReceivebps", "datapointName": "NetworkReceivebps", "consolidationFn": "average"}, {"name": "NetworkTransmitbps", "datapointName": "NetworkTransmitbps", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Receive", "color": "orange", "datapointName": "NetworkReceivebps", "isVirtual": false}, {"type": "line", "legend": "Transmit", "color": "navy", "datapointName": "NetworkTransmitbps", "isVirtual": false}]}, {"name": "Percent Storage Used", "title": "Percent Storage Used", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "percentStorageUsed", "datapointName": "percentStorageUsed", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "percentStorageUsed", "color": "silver", "datapointName": "percentStorageUsed", "isVirtual": false}]}, {"name": "Replica Lag Normalized", "title": "Replica Lag Normalized", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ReplicaLagNormalized", "datapointName": "ReplicaLagNormalized", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "ReplicaLagNormalized", "color": "silver", "datapointName": "ReplicaLagNormalized", "isVirtual": false}]}, {"name": "Swap Usage", "title": "Swap Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": true, "datapoints": [{"name": "SwapUsage", "datapointName": "SwapUsage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "SwapUsage", "color": "navy", "datapointName": "SwapUsage", "isVirtual": false}]}]}

×DataSource: PaloAlto_Panorama_Devices (933)

{"name": "PaloAlto_Panorama_Devices", "description": "firewall to management console connectivity and synchronization", "appliesTo": "system.sysoid == \"1.3.6.1.4.1.25461.2.3.7\" && hasCategory(\"PaloAlto\")", "searchKeywords": "panorama,network,paloalto", "displayedAs": "Panorama Managed Devices", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\napikey = hostProps.get(\"paloalto.apikey.pass\")\nhost = hostProps.get(\"system.hostname\")\n\ncommand = java.net.URLEncoder.encode(\"<show><devicegroups></devicegroups></show>\")\nurl = \"https://${host}/api/?type=op&key=${apikey}&cmd=${command}\"\n\ndef response = new XmlSlurper().parseText(url.toURL().text)\n\nresponse.result.devicegroups.entry.each { devicegroup ->\n groupname = devicegroup.@name.text()\n devicegroup.devices.entry.each { device -> \n serial = device.\"serial\".text()\n sw_version = device.\"sw-version\".text()\n hostname = device.\"hostname\".text()\n model = device.\"model\".text()\n println \"${serial}##${groupname}/${hostname}##version=${sw_version} serial=${serial} model=${model}\"\n }\n}\n\nreturn 0"}, "groupMethod": "regex", "groupExpr": "dynamicGroup=\"^(.*)\\/\""}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\napikey = hostProps.get(\"paloalto.apikey.pass\")\nhost = hostProps.get(\"system.hostname\")\nserial = \"##WILDVALUE##\"\n\ndevicegroup_cmd = java.net.URLEncoder.encode(\"<show><devicegroups></devicegroups></show>\")\ntemplate_cmd = java.net.URLEncoder.encode(\"<show><templates></templates></show>\")\n\ndevicegroup_url = \"https://${host}/api/?type=op&key=${apikey}&cmd=${devicegroup_cmd}\"\ntemplate_url = \"https://${host}/api/?type=op&key=${apikey}&cmd=${template_cmd}\"\n\ndef devicegroup_response = new XmlSlurper().parseText(devicegroup_url.toURL().text)\ndef template_response = new XmlSlurper().parseText(template_url.toURL().text)\n\ndevice = devicegroup_response.result.'**'.find { node ->\n node.serial == serial\n}\ntemplate = template_response.result.'**'.find { node -> \n node.serial == serial\n}\n\nconnected = (device.connected.text() =~ /yes/).matches() ? 1 : 0\npolicysync = (device.\"shared-policy-status\".text() =~ /In Sync/).matches() ? 1 : 0\ntemplatesync = (template.\"template-status\".text() =~ /In Sync/).matches() ? 1 : 0\n\nprintln \"connected: ${connected}\"\nprintln \"policysync: ${policysync}\"\nprintln \"templatesync: ${templatesync}\"\n\nreturn 0"}, "datapoints": [{"name": "connected", "description": "1 if device is connected to panorama. 0 else", "interpretMethod": "namevalue", "interpretExpr": "connected", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "!= 1", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertSubject": "Panorama lost management connection to ##INSTANCE##", "alertBody": "Panorama server ##HOST## has lost management connectivity to ##INSTANCE## (##DSIDESCRIPTION##) and will not be able to receive logs or manage the device.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "policysync", "description": "1 if shared policy is in sync. 0 if not.", "interpretMethod": "namevalue", "interpretExpr": "policysync", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "!= 1", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertSubject": "Panorama policy config out of sync for ##INSTANCE##", "alertBody": "Panorama management policy config on ##HOST## is out of sync with managed device ##INSTANCE## (##DSIDESCRIPTION##). Please ensure that configuration is correctly committed and synced to devices.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "templatesync", "description": "1 if template is in sync between panorama management and device. 0 if not", "interpretMethod": "namevalue", "interpretExpr": "templatesync", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "!= 1", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertSubject": "Panorama template config out of sync for ##INSTANCE##", "alertBody": "Panorama management template config on ##HOST## is out of sync with managed device ##INSTANCE## (##DSIDESCRIPTION##). Please ensure that configuration is correctly committed and synced to devices.\n\nThis started at ##START## - or ##DURATION## ago."}], "graphs": [{"name": "Palo Alto Device Connectivity", "title": "Palo Alto Device Connectivity", "verticalLabel": "0 = disconnected / 1 = connected", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "connected", "datapointName": "connected", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "device connected", "color": "blue", "datapointName": "connected", "isVirtual": false}]}, {"name": "Palo Alto Device Synchronization", "title": "Palo Alto Device Synchronization", "verticalLabel": "0 = not in sync / 1 = in sync", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "policysync", "datapointName": "policysync", "consolidationFn": "average"}, {"name": "templatesync", "datapointName": "templatesync", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "policy synchronization", "color": "lime", "datapointName": "policysync", "isVirtual": false}, {"type": "line", "legend": "template synchronization", "color": "purple", "datapointName": "templatesync", "isVirtual": false}]}]}

×DataSource: Email_RoundTrip (461)

{"name": "Email_RoundTrip", "description": "Measures the time taken to deliver a given message from the collector to an smtp service, along with the time to retrieve the same message from the corresponding imap service", "appliesTo": "hasCategory(\"email_rtt\")", "searchKeywords": "round trip,imap,smtp,application,email,transfer time", "technicalNotes": "Setup information can be found at: https://www.logicmonitor.com/support/monitoring/applications-databases/email-service-monitoring/\n\nCollector versions 32.400 and up use jakarta mail jar instead of javax mail jar for this module.", "displayedAs": "Email: Round Trip Time", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// This maintains compatibility while we transfer from javax to jakarta.\n// When jakarta hits MGD we should change to using standard imports instead.\ndef LoadMailClass(classname) {\n\ttry {\n\t\treturn this.class.classLoader.loadClass(\"jakarta.mail.${classname}\")\n\t} catch (ex) {\n\t\treturn this.class.classLoader.loadClass(\"javax.mail.${classname}\")\n\t}\n}\n\ndef protocolDebug = true\n\ndef host = hostProps.get(\"system.hostname\")\n\ndef smtpHost = hostProps.get(\"smtp.host\") // Required\ndef smtpType = hostProps.get(\"smtp.type\") // Optional\n\ndef imapHost = hostProps.get(\"imap.host\") // Required\ndef imapType = hostProps.get(\"imap.type\") // Optional\n\ndef emailUser = hostProps.get(\"email.user\") // Required\ndef emailPass = hostProps.get(\"email.pass\") // Required\ndef emailAddr = hostProps.get(\"email.addr\") // Required\n\ndef forceTLS25 = hostProps.get(\"smtp.force.TLS.25\") // Optional switch to force TLS use on port 25 if the property smtp.force.TLS.25 is set to true\n\n// Cleanup property\nif (forceTLS25 != null && forceTLS25 instanceof String) {\n\tforceTLS25 = forceTLS25.toLowerCase().toBoolean()\n}\n\n// Do we have all required params?\nif (!smtpHost || !imapHost || !emailUser || !emailPass || !emailAddr ) {\n\tprintln(\"errorCode=-1\")\n\treturn 0\n}\n\ndef protoDebugFile = new PrintStream(\"../logs/${host}-emailRTT-protocol.log\")\ndef scriptDebugFile = new File(\"../logs/${host}-emailRTT-debug.log\")\nscriptDebugFile.delete()\n\n// Used in combination with RecordTime to store elapsed time.\ndef lastTime = [System.currentTimeMillis()] // Use an array in order to pass lastTime by reference.\n\ndef RecordTime(name, lastTime) { //Prints the elapsed time (in seconds) since it was last called\n\tdef elapsed = System.currentTimeMillis() - lastTime[0]\n\n\tdef elapsedSec = elapsed / 1000\n\n\tif (name) {\n\t\tprintln(\"${name}=${elapsedSec}\")\n\t}\n\n\t// Reset the lastTime called\n\tlastTime[0] = System.currentTimeMillis()\n\n\treturn (elapsedSec)\n}\n\n// SMTP setup\n\ndef smtpProps = System.getProperties()\ndef transportType = \"smtp\"\n\n// Which type of SMTP connection (dictates the port properties)\nif (smtpType == \"TLS\") {\n\tsmtpProps.setProperty(\"mail.smtp.starttls.enable\", \"true\")\n\tsmtpProps.setProperty(\"mail.smtp.auth\", \"true\")\n\tsmtpProps.setProperty(\"mail.smtp.host\", smtpHost)\n\tsmtpProps.setProperty(\"mail.smtp.port\", \"587\")\n\tsmtpProps.setProperty(\"mail.smtp.user\", emailUser)\n\tsmtpProps.setProperty(\"mail.smtp.password\", emailPass)\n\tsmtpProps.setProperty(\"mail.smtp.ssl.trust\", \"*\")\n} else if (smtpType == \"SSL\") {\n\ttransportType = \"smtps\"\n\tsmtpProps.setProperty(\"mail.transport.protocol\", \"smtps\")\n\tsmtpProps.setProperty(\"mail.smtp.socketFactory.port\", \"465\")\n\tsmtpProps.setProperty(\"mail.smtp.socketFactory.class\", \"javax.net.ssl.SSLSocketFactory\")\n\tsmtpProps.setProperty(\"mail.smtps.auth\", \"true\")\n\tsmtpProps.setProperty(\"mail.smtps.host\", smtpHost)\n\tsmtpProps.setProperty(\"mail.smtps.port\", \"465\")\n\tsmtpProps.setProperty(\"mail.smtps.user\", emailUser)\n\tsmtpProps.setProperty(\"mail.smtps.password\", emailPass)\n\tsmtpProps.setProperty(\"mail.smtps.ssl.trust\", \"*\")\n} else {\n\tsmtpProps.setProperty(\"mail.smtp.port\", \"25\")\n\tsmtpProps.setProperty(\"mail.smtp.auth\", \"true\")\n\tsmtpProps.setProperty(\"mail.smtp.host\", smtpHost)\n\tsmtpProps.setProperty(\"mail.smtp.user\", emailUser)\n\tsmtpProps.setProperty(\"mail.smtp.password\", emailPass)\n\tif(forceTLS25 == false) { // We check for false explicitly as it could also be null.\n\t\tsmtpProps.setProperty(\"mail.smtp.starttls.enable\", \"false\")\n\t}\n}\n\ndef smtpSession = LoadMailClass(\"Session\").getInstance(smtpProps, null)\nsmtpSession.setDebug(protocolDebug)\nsmtpSession.setDebugOut(protoDebugFile)\ndef smtp = smtpSession.getTransport(transportType)\n\n// IMAP setup\n\ndef imapProps = System.getProperties()\ndef storeType = \"imap\"\n\nif (imapType == \"SSL\") {\n\tstoreType = \"imaps\"\n\timapProps.setProperty(\"mail.imap.socketFactory.class\", \"javax.net.ssl.SSLSocketFactory\")\n\timapProps.setProperty(\"mail.imap.socketFactory.fallback\", \"false\")\n\timapProps.setProperty(\"mail.imap.socketFactory.port\", \"993\")\n\timapProps.setProperty(\"mail.imaps.ssl.trust\", \"*\")\n\timapProps.setProperty(\"mail.imaps.ssl.checkserveridentity\", \"false\")\n} else if (imapType == \"TLS\") {\n\timapProps.setProperty(\"mail.imap.starttls.enable\", \"true\")\n\timapProps.setProperty(\"mail.imap.socketFactory.port\", \"143\")\n} else {\n\timapProps.setProperty(\"mail.imap.socketFactory.port\", \"143\")\n\timapProps.setProperty(\"mail.imap.socketFactory.class\", \"javax.net.SocketFactory\")\n}\n\nimapProps.setProperty(\"mail.store.protocol\", storeType)\n\ndef imapSession = LoadMailClass(\"Session\").getInstance(imapProps, null)\nimapSession.setDebug(protocolDebug)\nimapSession.setDebugOut(protoDebugFile)\ndef imap = imapSession.getStore(storeType)\n\n// Message creation setup\n\ndef smtpMsgSubect = \"Message Round-Trip Test - ${System.currentTimeMillis()}\"\n\ndef smtpMessage = LoadMailClass(\"internet.MimeMessage\").newInstance(smtpSession)\nsmtpMessage.setFrom(LoadMailClass(\"internet.InternetAddress\").newInstance(emailAddr))\nsmtpMessage.addRecipient(LoadMailClass(\"Message\\$RecipientType\").TO, LoadMailClass(\"internet.InternetAddress\").newInstance(emailAddr))\nsmtpMessage.setSubject(smtpMsgSubect)\nsmtpMessage.setText(\"Delivered by LogicMonitor\")\n\n// Connect to smtp\n\ndef tries = 5\n\nwhile (tries > 0) {\n\ttries--\n\n\ttry {\n\t\tscriptDebugFile.append(\"Attempting SMTP Connection\\n\")\n\t\tsmtp.connect(smtpHost, emailUser, emailPass)\n\t\ttries = -1\n\t} catch (Exception e) {\n\t\tdef errorString = \"SMTP Connection Error: ${e.message}\\n\"\n\t\tscriptDebugFile.append(errorString)\n\t\tprintln(errorString)\n\t}\n}\n\nif (tries == -1) { // Were we able to connect to the smtp server?\n\tscriptDebugFile.append(\"SMTP Connection Successful\\n\")\n} else {\n\tprintln(\"errorCode=1\")\n\tprotoDebugFile.close()\n\treturn 0\n}\n\ndef smtpConnTime = RecordTime(\"SmtpConnTime\", lastTime)\n\n// Send message via SMTP\n\ntries = 5\n\nwhile (tries > 0) {\n\ttries--\n\n\ttry {\n\t\tscriptDebugFile.append(\"Attempting SMTP Message Delivery\\n\")\n\t\tsmtp.sendMessage(smtpMessage, smtpMessage.getAllRecipients())\n\t\ttries = -1\n\t} catch (Exception e) {\n\t\tdef errorString = \"SMTP Message Delivery Error: ${e.message}\\n\"\n\t\tscriptDebugFile.append(errorString)\n\t\tprintln(errorString)\n\t}\n}\n\nif (tries == -1) { // Were we able to deliver the message?\n\tscriptDebugFile.append(\"SMTP Message Delivery Successful\\n\")\n} else {\n\tprintln(\"errorCode=2\")\n\tprotoDebugFile.close()\n\treturn 0\n}\n\ndef smtpSendTime = RecordTime(\"SmtpSendTime\", lastTime)\n\nscriptDebugFile.append(\"Closing SMTP Connection\\n\")\nsmtp.close()\n\ndef smtpTotalTime = smtpConnTime + smtpSendTime\nprintln(\"SmtpTotalTime=${smtpTotalTime}\")\n\n// Connect to imap\n\nRecordTime(null, lastTime)\n\ntries = 5\n\nwhile (tries > 0) {\n\ttries--\n\n\ttry {\n\t\tscriptDebugFile.append(\"Attempting IMAP Connection\\n\")\n\t\timap.connect(imapHost, emailUser, emailPass)\n\t\ttries = -1\n\t} catch (Exception e) {\n\t\tdef errorString = \"IMAP Connection Error: ${e.message}\\n\"\n\t\tscriptDebugFile.append(errorString)\n\t\tprintln(errorString)\n\t\tsleep(1000)\n\t}\n}\n\nif (tries == -1) { // Were we able to connect to imap server?\n\tscriptDebugFile.append(\"IMAP Connection Successful\\n\")\n} else {\n\tprintln(\"errorCode=3\")\n\tprotoDebugFile.close()\n\treturn 0\n}\n\ndef imapConnTime = RecordTime(\"ImapConnTime\", lastTime)\n\n// Search inbox for the message we created earlier\n\ndef inbox = imap.getFolder(\"Inbox\")\n\n// Repeatedly search for 1 minutes with 1s sleep\ndef searchTerm = LoadMailClass(\"search.SubjectTerm\").newInstance(\"Message Round-Trip Test - \")\ndef foundMessage = false\ntries = 60\n\nwhile (tries > 0) {\n\ttry {\n\t\tinbox.open(LoadMailClass(\"Folder\").READ_WRITE) // Open the inbox do the search\n\n\t\tscriptDebugFile.append(\"Initiating new inbox search on subject \\\"Message Round-Trip Test - \\\"\\n\")\n\n\t\tdef searchResults = inbox.search(searchTerm)\n\t\tdef foundCount = searchResults.size()\n\n\t\tif (!foundCount) { // Did we find any messages?\n\t\t\tscriptDebugFile.append(\" - search found no messages -- sleeping\\n\")\n\t\t\tsleep(1000)\n\t\t} else {\n\t\t\tscriptDebugFile.append(\" - search found ${foundCount} messages\\n\")\n\n\t\t\tsearchResults.each { imapMessage ->\n\t\t\t\tdef foundSubject = imapMessage.getSubject()\n\n\t\t\t\t// Does the subject of this message match the subject of the message we sent earlier?\n\t\t\t\tif (foundSubject == smtpMsgSubect) {\n\t\t\t\t\ttries = -1\n\t\t\t\t\tfoundMessage = true\n\t\t\t\t\tscriptDebugFile.append(\" - located target message \\\"${foundSubject}\\\"\\n\")\n\t\t\t\t}\n\n\t\t\t\t// Flag any messages that matched this search for deletion\n\t\t\t\timapMessage.setFlag(LoadMailClass(\"Flags\\$Flag\").DELETED, true)\n\t\t\t\tscriptDebugFile.append(\" - delete flag set on \\\"${foundSubject}\\\"\\n\")\n\t\t\t}\n\n\t\t\t// Expunge the deleted messages\n\t\t\tscriptDebugFile.append(\" - expunging deleted message(s)\\n\")\n\t\t\tinbox.expunge()\n\t\t}\n\n\t\tinbox.close(true)\n\t\tscriptDebugFile.append(\" - inbox closed\\n\")\n\t} catch (Exception e) {\n\t\t// Something blew up\n\t\tdef errorString = \"IMAP Inbox Search Error: ${e.message}\"\n\t\tscriptDebugFile.append(\"${errorString}\\n\")\n\t\tprintln(errorString)\n\n\t\t// Because something blew up, lets make sure our inbox is closed.\n\t\tinbox.close(true)\n\t\tsleep(1000)\n\t}\n\n\ttries--\n}\n\nif (!foundMessage) {\n\tprintln(\"errorCode=4\")\n\tprotoDebugFile.close()\n\treturn 0\n}\n\ndef imapSearchTime = RecordTime(\"ImapSearchTime\", lastTime)\n\nscriptDebugFile.append(\"Closing IMAP Connection\\n\")\nimap.close()\n\ndef imapCloseTime = RecordTime(\"ImapCloseTime\", lastTime)\ndef imapTotalTime = imapConnTime + imapSearchTime + imapCloseTime\n\nprintln(\"ImapTotalTime=${imapTotalTime}\")\n\nprintln(\"errorCode=0\")\n\nreturn 0"}, "datapoints": [{"name": "ErrorCode", "description": "Error Codes:\n-1=Missing Params, \n0=OK, \n1=SMTP connection failure, \n2=SMTP send failure, \n3=IMAP connection failure, \n4=IMAP search failure, \n5=IMAP close error", "interpretMethod": "namevalue", "interpretExpr": "errorCode", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "5", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "The email message round-trip time monitor assigned on device ##HOST## indicates an error code of ##VALUE## on this measurement, which leaves this device in a ##LEVEL## state. \n\nError Codes:\n-1=Missing Params, \n0=OK, \n1=SMTP connection failure, \n2=SMTP send failure, \n3=IMAP connection failure, \n4=IMAP search failure, \n5=IMAP close error\n\nThis started at ##START## -- or ##DURATION## ago. Consider investigating problems with your email service provider to understand what might be causing this behavior."}, {"name": "ImapCloseTime", "description": "time to close the imap connect", "interpretMethod": "namevalue", "interpretExpr": "ImapCloseTime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ImapConnTime", "description": "time to initiate imap connection", "interpretMethod": "namevalue", "interpretExpr": "ImapConnTime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ImapSearchTime", "description": "time to perform imap message search", "interpretMethod": "namevalue", "interpretExpr": "ImapSearchTime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ImapTotalTime", "description": "total time required to retrieve message", "interpretMethod": "namevalue", "interpretExpr": "ImapTotalTime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "RoundTripTime", "description": "Time required to send and deliver message in minutes", "interpretMethod": "expression", "interpretExpr": "(SmtpTotalTime+ImapTotalTime) / 60", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 2", "noData": "Do not trigger an alert", "triggerInterval": 20, "clearInterval": 0, "alertBody": "The email message round-trip time monitor assigned on device ##HOST## reported a value of ##VALUE##. This indicates a longer than normal round-trip time. This alert is triggered when consecutive round trips noted in the Alert trigger interval take over 2 min's to complete in a row putting this device into ##LEVEL## state. \n\nThis started at ##START## - or ##DURATION## ago. \n\nConsider investigating problems with your email service provider to understand what might be causing this behavior."}, {"name": "SmtpConnTime", "description": "time to initiate smtp connection", "interpretMethod": "namevalue", "interpretExpr": "SmtpConnTime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SmtpSendTime", "description": "time to deliver smtp message", "interpretMethod": "namevalue", "interpretExpr": "SmtpSendTime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SmtpTotalTime", "description": "total time required to send message", "interpretMethod": "namevalue", "interpretExpr": "SmtpTotalTime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}], "graphs": [{"name": "Round Trip Detail", "title": "Message Round Trip Detail", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "ImapCloseTime", "datapointName": "ImapCloseTime", "consolidationFn": "average"}, {"name": "ImapConnTime", "datapointName": "ImapConnTime", "consolidationFn": "average"}, {"name": "ImapSearchTime", "datapointName": "ImapSearchTime", "consolidationFn": "average"}, {"name": "SmtpConnTime", "datapointName": "SmtpConnTime", "consolidationFn": "average"}, {"name": "SmtpSendTime", "datapointName": "SmtpSendTime", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "IMAP Close", "color": "red", "datapointName": "ImapCloseTime", "isVirtual": false}, {"type": "stack", "legend": "IMAP Connection", "color": "yellow", "datapointName": "ImapConnTime", "isVirtual": false}, {"type": "stack", "legend": "IMAP Search", "color": "orange", "datapointName": "ImapSearchTime", "isVirtual": false}, {"type": "stack", "legend": "SMTP Connection", "color": "blue", "datapointName": "SmtpConnTime", "isVirtual": false}, {"type": "stack", "legend": "SMTP Send", "color": "navy", "datapointName": "SmtpSendTime", "isVirtual": false}]}, {"name": "Round Trip Time", "title": "Message Round Trip Time", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "ImapTotalTime", "datapointName": "ImapTotalTime", "consolidationFn": "average"}, {"name": "SmtpTotalTime", "datapointName": "SmtpTotalTime", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Retrieval", "color": "orange", "datapointName": "ImapTotalTime", "isVirtual": false}, {"type": "stack", "legend": "Delivery", "color": "blue", "datapointName": "SmtpTotalTime", "isVirtual": false}]}, {"name": "Transaction Status", "title": "Transaction Status", "verticalLabel": "status code", "min": -2.0, "max": 6.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "ErrorCode", "datapointName": "ErrorCode", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "-1=missing params, 0=ok, 1=smtp connection failure, 2=smtp send failure, 3=imap connection failure, 4=imap search failure, 5=imap close error", "color": "black", "datapointName": "ErrorCode", "isVirtual": false}]}]}

×DataSource: Email_TransitTime (462)

{"name": "Email_TransitTime", "description": "Measures the time taken to collect an email sent from one service to another.", "appliesTo": "hasCategory(\"email_transit\")", "searchKeywords": "imap,smtp,application,transit time,email", "technicalNotes": "The instance must be set as colon-separated list of service keys e.g. \"gmail:yahoo\" where the first key is the sender service and second key is the recipient service.\n\nFurther information can be found at: https://www.logicmonitor.com/support/monitoring/applications-databases/email-service-monitoring/\n\nCollector versions 32.400 and up use jakarta mail jar instead of javax mail jar for this module.", "displayedAs": "Email: Transit Time", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": false, "discoveryMethod": "", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// This maintains compatibility while we transfer from javax to jakarta.\n// When jakarta hits MGD we should change to using standard imports instead.\ndef LoadMailClass(classname) {\n\ttry {\n\t\treturn this.class.classLoader.loadClass(\"jakarta.mail.${classname}\")\n\t} catch (ex) {\n\t\treturn this.class.classLoader.loadClass(\"javax.mail.${classname}\")\n\t}\n}\n\nimport groovy.time.*\n\n// Enable protocol debugging?\ndef protocolDebug = true\n\n// wildvalue must be set as colon-separated list of\n// service keys e.g. \"gmail:yahoo\" where the first key\n// is the sender service and second key is the\n// recipient service\ndef instance = instanceProps.get(\"wildvalue\")\n\n// Does the wildvalue contain a colon?\nif (!instance.contains(':')) {\n\t// No, return the error code for bad instance value.\n\tprintln(\"errorCode=-2\")\n\treturn 0\n}\n\ndef (sender, recipient) = instance.split(':')\n\ndef smtpUser = hostProps.get(\"transit.${sender}.user\")\ndef smtpPass = hostProps.get(\"transit.${sender}.pass\")\ndef smtpHost = hostProps.get(\"transit.${sender}.smtpHost\")\ndef smtpPort = hostProps.get(\"transit.${sender}.smtpPort\")\ndef smtpType = hostProps.get(\"transit.${sender}.smtpType\")\ndef fromAddr = hostProps.get(\"transit.${sender}.addr\")\n\ndef imapUser = hostProps.get(\"transit.${recipient}.user\")\ndef imapPass = hostProps.get(\"transit.${recipient}.pass\")\ndef imapHost = hostProps.get(\"transit.${recipient}.imapHost\")\ndef imapType = hostProps.get(\"transit.${recipient}.imapType\")\ndef toAddr = hostProps.get(\"transit.${recipient}.addr\")\n\n\ndef forceTLS25 = hostProps.get(\"smtp.force.TLS.25\") // Optional switch to force TLS use on port 25 if the property smtp.force.TLS.25 is set to true\n\n// Cleanup property\nif (forceTLS25 != null && forceTLS25 instanceof String) {\n\tforceTLS25 = forceTLS25.toLowerCase().toBoolean()\n}\n\nif (!smtpUser || !smtpPass || !smtpHost || !fromAddr || !imapUser || !imapPass || !imapHost || !toAddr) {\n\tprintln(\"errorCode=-1\")\n\treturn 0\n}\n\ndef hostName = hostProps.get(\"system.hostname\")\n\ndef protoDebugFile = new PrintStream(\"../logs/${hostName}-${instance.replace(':', '-')}-emailTransit-protocol.log\")\ndef scriptDebugFile = new File(\"../logs/${hostName}-${instance.replace(':', '-')}-emailTransit-debug.log\")\nscriptDebugFile.delete()\n\n// Time measurement\ndef startSearchTime = null\ndef rawSentTime = null\ndef perfStart = null\n\n// SMTP\ndef smtpProps = System.getProperties()\nsmtpProps.put(\"mail.smtp.auth\", \"true\")\nsmtpProps.put(\"mail.smtp.host\", smtpHost)\nsmtpProps.put(\"mail.smtp.user\", smtpUser)\nsmtpProps.put(\"mail.smtp.password\", smtpPass)\n\n// Which type of SMTP connection\nif (smtpType == \"TLS\") {\n\tsmtpProps.put(\"mail.smtp.port\", smtpPort ?: \"587\")\n\tsmtpProps.put(\"mail.smtp.starttls.enable\", \"true\")\n\tsmtpProps.put(\"mail.smtp.ssl.trust\", smtpHost)\n} else if (smtpType == \"SSL\") {\n\tsmtpProps.put(\"mail.smtps.port\", smtpPort ?: \"465\")\n\tsmtpProps.put(\"mail.smtp.socketFactory.port\", smtpPort ?: \"465\")\n\tsmtpProps.put(\"mail.transport.protocol\", \"smtps\")\n\tsmtpProps.put(\"mail.smtp.socketFactory.class\", \"javax.net.ssl.SSLSocketFactory\")\n\tsmtpProps.put(\"mail.smtp.ssl.trust\", smtpHost)\n} else {\n\tsmtpProps.put(\"mail.smtp.port\", smtpPort ?: \"25\")\n\tif(forceTLS25 == false) { // We check for false explicitly as it could also be null.\n\t\tsmtpProps.setProperty(\"mail.smtp.starttls.enable\", \"false\")\n\t}\n}\n\ndef smtpSession = LoadMailClass(\"Session\").getInstance(smtpProps, null)\nsmtpSession.setDebug(protocolDebug)\nsmtpSession.setDebugOut(protoDebugFile)\n\ndef smtp = smtpSession.getTransport(smtpType == \"SSL\" ? \"smtps\" : \"smtp\")\n\n// IMAP\ndef imapProps = System.getProperties();\nimapProps.setProperty(\"mail.store.protocol\", imapType == \"SSL\" ? \"imaps\" : \"imap\")\n\n// Which type of IMAP connection?\nif (imapType == \"SSL\") {\n\timapProps.setProperty(\"mail.imap.socketFactory.class\", \"javax.net.ssl.SSLSocketFactory\")\n\timapProps.setProperty(\"mail.imap.socketFactory.fallback\", \"false\")\n\timapProps.setProperty(\"mail.imap.socketFactory.port\", \"993\")\n} else if (imapType == \"TLS\") {\n\timapProps.setProperty(\"mail.imap.starttls.enable\", \"true\")\n\timapProps.setProperty(\"mail.imap.socketFactory.port\", \"143\")\n} else {\n\timapProps.setProperty(\"mail.imap.socketFactory.port\", \"143\")\n\timapProps.setProperty(\"mail.imap.socketFactory.class\", \"javax.net.SocketFactory\")\n}\n\ndef imapSession = LoadMailClass(\"Session\").getInstance(imapProps, null)\nimapSession.setDebug(protocolDebug)\nimapSession.setDebugOut(protoDebugFile)\n\ndef imap = imapSession.getStore(imapProps[\"mail.store.protocol\"])\n\n// Message Creation\ndef smtpMsgSubect = \"Message Transit Test - ${System.currentTimeMillis()}\"\n\ndef smtpMessage = LoadMailClass(\"internet.MimeMessage\").newInstance(smtpSession)\nsmtpMessage.setFrom(LoadMailClass(\"internet.InternetAddress\").newInstance(fromAddr))\nsmtpMessage.addRecipient(LoadMailClass(\"Message\\$RecipientType\").TO, LoadMailClass(\"internet.InternetAddress\").newInstance(toAddr))\nsmtpMessage.setSubject(smtpMsgSubect)\nsmtpMessage.setText(\"Delivered by LogicMonitor\")\n\n// Search Info\ndef searchTerm = LoadMailClass(\"search.SubjectTerm\").newInstance(\"Message Transit Test - \")\ndef foundMessage = false\n\n// The minimum time we will wait before retrying a search (in ms).\n// Increase to 100ms or higher if server performance is a concern.\n// Higher values reduce accuracy but are less intense for the server.\ndef minRetryTime = 0\n\n// IMAP Connect\ndef tries = 5\n\nwhile (tries > 0) {\n\ttries--\n\n\ttry {\n\t\tscriptDebugFile.append(\"Attempting IMAP Connection\\n\")\n\t\timap.connect(imapHost, imapUser, imapPass)\n\t\ttries = -1\n\t} catch (Exception e) {\n\t\tdef errorString = \"IMAP Connection Error: ${e.message}\\n\"\n\t\tscriptDebugFile.append(errorString)\n\t\tprintln(errorString)\n\t\tsleep(1000)\n\t}\n}\n\n// Were we able to connect to imap server?\nif (tries == -1) {\n\t// yes. log some debugging\n\tscriptDebugFile.append(\"IMAP Connection Successful\\n\")\n} else {\n\t// no. exit\n\tprintln(\"errorCode=3\")\n\tprotoDebugFile.close()\n\treturn 0\n}\n\n\n// Connect to SMTP server\n\ntries = 5\n\nwhile (tries > 0) {\n\ttries--\n\n\ttry {\n\t\tscriptDebugFile.append(\"Attempting SMTP Connection\\n\")\n\t\tsmtp.connect(smtpHost, smtpUser, smtpPass)\n\t\ttries = -1\n\t} catch (Exception e) {\n\t\tdef errorString = \"SMTP Connection Error: ${e.message}\\n\"\n\t\tscriptDebugFile.append(errorString)\n\t\tprintln(errorString)\n\t}\n}\n\n// Were we able to connect to the smtp server?\nif (tries == -1) {\n\tscriptDebugFile.append(\"SMTP Connection Successful\\n\")\n} else {\n\tprintln(\"errorCode=1\")\n\tprotoDebugFile.close()\n\treturn 0\n}\n\n// Open inbox before we send to avoid taking the time hit later.\ndef inbox = imap.getFolder(\"Inbox\")\n\ntries = 5\n\nwhile (tries > 0) {\n\ttries--\n\n\ttry {\n\t\tinbox.open(LoadMailClass(\"Folder\").READ_WRITE)\n\t\tscriptDebugFile.append(\"Inbox Opened (Pre-Send)\\n\")\n\n\t\ttries = -1\n\t} catch (Exception e) {\n\t\tdef errorString = \"Inbox Opening Error: ${e.message}\\n\"\n\t\tscriptDebugFile.append(errorString)\n\t\tprintln(errorString)\n\t}\n}\n\n// SMTP Send\n\ntries = 5\n\nwhile (tries > 0) {\n\ttries--\n\n\ttry {\n\t\tscriptDebugFile.append(\"Attempting SMTP Message Delivery\\n\")\n\n\t\tsmtpMessage.setSentDate(new Date())\n\t\tsmtp.sendMessage(smtpMessage, smtpMessage.getAllRecipients())\n\n\t\t// From this point on, we have to try to do as little unnessisary code as possible so as not to add to the result.\n\t\trawSentTime = new Date()\n\n\t\ttries = -1\n\t} catch (Exception e) {\n\t\tdef errorString = \"SMTP Message Delivery Error: ${e.message}\\n\"\n\t\tscriptDebugFile.append(errorString)\n\t\tprintln(errorString)\n\t}\n}\n\n// Were we able to deliver the message?\nif (tries == -1) {\n\t// Yes. Log some debugging\n\tscriptDebugFile.append(\"SMTP Message Delivery Successful\\n\")\n} else {\n\t// No, close the inbox, print the error and exit.\n\tif(inbox.isOpen()) {\n\t\tinbox.close(false)\n\t}\n\n\tprintln(\"errorCode=2\")\n\tprotoDebugFile.close()\n\treturn 0\n}\n\n// Search inbox for the message we created earlier\ndef retryTotal = 3000\n\ntries = retryTotal\nstartSearchTime = new Date().getTime()\n\nwhile (tries > 0) {\n\ttry {\n\t\tscriptDebugFile.append(\"Starting search for message(s) in inbox\\n\")\n\n\t\t// Open the inbox if its not open already.\n\t\tif(!inbox.isOpen()) {\n\t\t\tperfStart = new Date().getTime()\n\t\t\tinbox.open(LoadMailClass(\"Folder\").READ_WRITE)\n\t\t\tscriptDebugFile.append(\" - Inbox opened in ${new Date().getTime() - perfStart} ms\\n\")\n\t\t}\n\n\t\tdef searchResults = inbox.search(searchTerm);\n\n\t\t// As soon as we have results, we know something with a matching subject is found. This might be our time.\n\t\tdef potentialTime = (new Date().getTime() - rawSentTime.getTime()) / 1000\n\n\t\tdef foundCount = searchResults.size()\n\n\t\t// did we find any messages?\n\t\tif (foundCount == 0) {\n\t\t\t// no -- sleep for a bit\n\t\t\tscriptDebugFile.append(\" - Search found no message(s)\\n\")\n\t\t} else {\n\t\t\t// yes. iterate through the search results array\n\t\t\tscriptDebugFile.append(\" - Search found ${foundCount} message(s)\\n\")\n\n\t\t\t// iterate through results\n\t\t\tsearchResults.each { imapMessage ->\n\t\t\t\t// Only proceed if the message isn't empty or null.\n\t\t\t\tif(imapMessage) {\n\t\t\t\t\tdef foundSubject = imapMessage.getSubject()\n\n\t\t\t\t\t// Does the subject of this message match the subject of the message we sent earlier?\n\t\t\t\t\tif (foundSubject.contains(smtpMsgSubect)) {\n\t\t\t\t\t\t// Yes! We found our message!\n\t\t\t\t\t\tfoundMessage = true\n\n\t\t\t\t\t\tscriptDebugFile.append(\" - Located target message [${foundSubject}]\\n\")\n\n\t\t\t\t\t\tprintln \"retries=${retryTotal - tries}\"\n\n\t\t\t\t\t\t// print the transit time\n\t\t\t\t\t\tprintln \"msgTransitTimeSec=${potentialTime}\"\n\n\t\t\t\t\t\t// Exit next loop\n\t\t\t\t\t\ttries = -1\n\t\t\t\t\t}\n\n\t\t\t\t\tdef sent = imapMessage.getSentDate() ?: backupSentTime\n\t\t\t\t\tdef age = new Date().getTime() - sent.getTime()\n\n\t\t\t\t\t// Are there any of our messages older than 60 seconds?\n\t\t\t\t\tif(foundSubject == smtpMsgSubect || age > 60000) {\n\t\t\t\t\t\t// Flag any messages that matched this search for deletion\n\t\t\t\t\t\timapMessage.setFlag(LoadMailClass(\"Flags\\$Flag\").DELETED, true)\n\t\t\t\t\t\tscriptDebugFile.append(\" - Delete flag set on [${foundSubject}]\\n\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tscriptDebugFile.append(\" - Expunging deleted message(s)\\n\")\n\t\t\tinbox.expunge() // Expunge the deleted messages\n\t\t}\n\t} catch (Exception e) {\n\t\t// Error found when searching. Given our older version of javax.mail this is not uncommon.\n\t\t// Index out of bounds errors are a known bug with that lib. Increasing minRetryTime can remedy this at the cost of accuracy.\n\t\terror_string = \"IMAP Inbox Search Error: ${e.message}\"\n\t\tscriptDebugFile.append(error_string + \"\\n\")\n\t\tprintln(error_string)\n\t}\n\n\tdef inboxResetTime = 0\n\tperfStart = new Date().getTime()\n\n\tif(inbox.isOpen()) {\n\t\tinbox.close(false)\n\t\tinboxResetTime = new Date().getTime() - perfStart\n\t\tscriptDebugFile.append(\" - Inbox closed in ${new Date().getTime() - perfStart} ms\\n\")\n\t}\n\n\t// If we've not found our message\n\tif(!foundMessage) {\n\t\t// Calculate how long we need to sleep to hit our min time.\n\t\tdef sleepTime = Math.max(minRetryTime - inboxResetTime, 0)\n\t\tsleep(sleepTime)\n\n\t\tscriptDebugFile.append(\" - ${sleepTime == 0 ? \"Retrying ASAP\" : \"retrying in ${sleepTime} ms\"}\\n\")\n\t}\n\n\t// How long have we been searching?\n\tdef searchTime = new Date().getTime() - startSearchTime\n\n\tif(searchTime > 30000) {\n\t\t// We've been searching over 30 seconds. Timeout.\n\t\tscriptDebugFile.append(\" - Timout searching after ${searchTime / 1000} seconds\\n\")\n\t}\n\n\ttries--\n}\n\n// We hold off closing the collection until after the search as it takes time.\nscriptDebugFile.append(\"Closing SMTP Connection\\n\")\nsmtp.close()\n\nif (!foundMessage) {\n\tprintln(\"errorCode=4\")\n\tprotoDebugFile.close()\n\treturn 0\n}\n\nscriptDebugFile.append(\"Closing IMAP Connection\\n\")\nimap.close()\n\n// Everything went well\nprintln(\"errorCode=0\")\n\n// Uncomment this to print detailed logs in !groovy\n//return \"\\n----------\\n${scriptDebugFile.text}----------\\n\"\n\nreturn 0"}, "datapoints": [{"name": "ErrorCode", "description": "-2=InvalidInstance -1=MissingParams 0=OK 1=SmtpConnectionFailure 2=SmtpSendFailure 3=ImapConnectionFailure 4=ImapSearchFailure 5=ImapCloseFailure", "interpretMethod": "namevalue", "interpretExpr": "errorCode", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-2", "max": "5", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "The email message transit time monitor ##DSIDESCRIPTION## assigned indicates that host ##HOST## has an error code of ##VALUE## on this measurement, which puts this instance in a ##LEVEL## state. These error codes are assigned as follows:\n\n\n0: ok\n1: smtp connection failure\n2: smtp delivery failure\n3: imap connection failure\n4: imap search failure\n5: imap close failure\n\nThis condition started at ##START## -- or ##DURATION## ago. Consider investigating problems with your email service provider to understand what might be causing this behavior."}, {"name": "Retries", "description": "The number of times the email was searched for before it was found in the inbox.", "interpretMethod": "namevalue", "interpretExpr": "Retries", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TransitTimeSec", "description": "Time message was in transit in seconds.", "interpretMethod": "namevalue", "interpretExpr": "msgTransitTimeSec", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "> 20", "noData": "Trigger warning alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "The email message transit time monitor ##DSIDESCRIPTION## is reporting a transit time of ##VALUE## seconds on host ##HOST##, which puts this instance in a ##LEVEL## state.\n\nThis condition started at ##START## -- or ##DURATION## ago. Consider investigating problems with your email service provider to understand what might be causing this behavior."}], "graphs": [{"name": "Retries", "title": "Retries", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Retries", "datapointName": "Retries", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "Number of Retries", "color": "orange", "datapointName": "Retries", "isVirtual": false}]}, {"name": "Transaction Status", "title": "Transaction Status", "verticalLabel": "status code", "min": -3.0, "max": 6.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "ErrorCode", "datapointName": "ErrorCode", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "-2=InvalidInstance -1=MissingParams 0=OK 1=SmtpConnectionFailure 2=SmtpSendFailure 3=ImapConnectionFailure 4=ImapSearchFailure 5=ImapCloseFailure", "color": "black", "datapointName": "ErrorCode", "isVirtual": false}]}, {"name": "Transit Time", "title": "Message Transit Time", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "MsgTransitTime", "datapointName": "TransitTimeSec", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Transit Time", "color": "orange", "datapointName": "MsgTransitTime", "isVirtual": false}]}], "overviewGraphs": [{"name": "Transit Time Overview", "title": "Transit Time Overview", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "MsgTransitTime", "datapointName": "TransitTimeSec", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "blue", "datapointName": "MsgTransitTime", "isVirtual": false}]}]}

×DataSource: Win2k12_HyperV_HypervisorStats (642)

{"name": "Win2k12_HyperV_HypervisorStats", "description": "HyperV Hypervisor Run-time Statistics for Win2k12 and later. For systems with more than one node per VM you need Win2K12_HyperV_HypervisorMemory to get memory pressure and available memory. This datasource will only work with a VM hosted on one node. This was done for backward compatability", "appliesTo": "isWindows() && !(hasCategory(\"WSFC_VNN\") || hasCategory(\"NLB_VNN\"))", "searchKeywords": "virtualization,os,hypervisor,windows,hyperv", "displayedAs": "HyperV Hypervisor Statistics", "collectionInterval": "2m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = '##SYSTEM.HOSTNAME##'\n$collectorName = hostname\n$winrmenabled = '##AUTO.WINRM##'\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\") {\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName\n}\n\n$SessionParams = @{\n ErrorAction = 'Stop'\n}\n$Opt = New-CimSessionOption -Protocol Dcom\n#-----Determine the type of query to make-----\n# check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($hostname -match $collectorName) {\n #Do nothing\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($wmi_user) -and [string]::IsNullOrWhiteSpace($wmi_pass)) -or (($wmi_user -like '*WMI.USER*') -and ($wmi_pass -like '*WMI.PASS*'))) {\n \n $SessionParams.ComputerName = $hostname\n\n if ($winrmenabled -notlike 'enabled') {\n $SessionParams.SessionOption = $Opt\n }\n} else {\n\n $SessionParams.ComputerName = $hostname\n # yes. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $wmi_pass -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $wmi_user, $remote_pass;\n $SessionParams.Credential = $remote_credential\n\n if ($winrmenabled -notlike 'enabled') {\n $SessionParams.SessionOption = $Opt\n }\n}\n\n$session = New-CimSession @SessionParams\n\n$os_version = Get-CimInstance -CimSession $Session -ClassName Win32_OperatingSystem | Select -ExpandProperty Version;\n\n$os_maj_ver, $os_min_ver, $os_point_ver = $os_version.split('.');\n\n# is this a win2k12 or later host\nif (($os_maj_ver -eq 6) -and ($os_min_ver -ge 2))\n{\n $hv_summary = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_VmmsVirtualMachineStats_HyperVVirtualMachineHealthSummary -Namespace root\\cimv2\n\n # did we get a result from hypervisory summary\n if ( $hv_summary )\n {\n # yes. write an instance\n Write-Host \"Hypervisor Statistics##Hypervisor Statistics\"\n }\n} \nGet-CimSession | Remove-CimSession\nEXIT 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = '##SYSTEM.HOSTNAME##'\n$collectorName = hostname\n$winrmenabled = '##AUTO.WINRM##'\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\") {\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName\n}\n\n$SessionParams = @{\n ErrorAction = 'Stop'\n}\n$Opt = New-CimSessionOption -Protocol Dcom\n#-----Determine the type of query to make-----\n# check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($hostname -match $collectorName) {\n \n #Do nothing\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($wmi_user) -and [string]::IsNullOrWhiteSpace($wmi_pass)) -or (($wmi_user -like '*WMI.USER*') -and ($wmi_pass -like '*WMI.PASS*'))) {\n \n $SessionParams.ComputerName = $hostname\n\n if ($winrmenabled -notlike 'enabled') {\n $SessionParams.SessionOption = $Opt\n }\n} else {\n\n $SessionParams.ComputerName = $hostname\n # yes. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $wmi_pass -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $wmi_user, $remote_pass;\n $SessionParams.Credential = $remote_credential\n\n if ($winrmenabled -notlike 'enabled') {\n $SessionParams.SessionOption = $Opt\n }\n}\n\n$session = New-CimSession @SessionParams\n\n$health_stats = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_VmmsVirtualMachineStats_HyperVVirtualMachineHealthSummary -Namespace root\\cimv2\n$vmbus_stats = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_Counters_HyperVVirtualMachineBus -Namespace root\\cimv2\n$lp_runtime_stats = Get-CimInstance -CimSession $Session -Query 'SELECT * FROM Win32_PerfFormattedData_HvStats_HyperVHypervisorLogicalProcessor WHERE name=\"_Total\"' -Namespace root\\cimv2\n$vp_runtime_stats = Get-CimInstance -CimSession $Session -Query 'SELECT * FROM Win32_PerfFormattedData_HvStats_HyperVHypervisorVirtualProcessor WHERE name=\"_Total\"' -Namespace root\\cimv2\n$rvp_runtime_stats = Get-CimInstance -CimSession $Session -Query 'SELECT * FROM Win32_PerfFormattedData_HvStats_HyperVHypervisorRootVirtualProcessor WHERE name=\"_Total\"' -Namespace root\\cimv2\n$mem_runtime_stats = Get-CimInstance -CimSession $Session `\n-ClassName Win32_PerfFormattedData_BalancerStats_HyperVDynamicMemoryBalancer `\n-Namespace root\\cimv2\n\nWrite-Host \"#### HEALTH STATE \";\n\n# iterate through health stats\nforeach ($metric in $health_stats)\n{\n $metric\n}\n\nWrite-Host \"#### VM BUS \";\n\n# iterate through vmbus stats\nforeach ($metric in $vmbus_stats)\n{\n $metric\n}\n\n# do not print out memory stats if there are more than one. It will be handled by a different datasource\nif (($mem_runtime_stats | Select-object Name).count -eq 1 ) {\n # iterate through each memory stat.\n Write-Host \"#### MEMORY \";\n foreach ($metric in $mem_runtime_stats)\n {\n $metric\n }\n}\nWrite-Host \"#### LOGICAL PROCESSOR TOTAL\";\n\n# iterate through logical processor stats\nforeach ($metric in $lp_runtime_stats)\n{\n $metric\n}\n\nWrite-Host \"#### VIRTUAL PROCESSOR TOTAL \";\n\n# iterate through vp processor stats\nforeach ($metric in $vp_runtime_stats)\n{\n Write-Host \"tvpPercentTotalRunTime :\" $metric.PercentTotalRunTime\n}\n\nWrite-Host \"#### ROOT VIRTUAL PROCESSOR \";\n\n# iterate through root virtual processor stats\nforeach ($metric in $rvp_runtime_stats)\n{\n Write-Host \"rvpPercentTotalRunTime :\" $metric.PercentTotalRunTime\n}\nGet-CimSession | Remove-CimSession\nEXIT 0"}, "datapoints": [{"name": "AvailableMemory", "description": "free memory available to the hypervisor (MB)", "interpretMethod": "regex", "interpretExpr": "AvailableMemory\\s+:\\s+(\\d+)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "AveragePressure", "description": "ratio indicating how much memory requested by VMs to the amount of memory the hypervisor has allocated to these VMs; if this exceeds 100 VMs will begin paging, resulting in a performance degradation", "interpretMethod": "regex", "interpretExpr": "AveragePressure\\s+:\\s+(\\d+)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 90 100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The average memory pressure on Hyper-V host ##HOST## is now ##VALUE##%, which puts this device in a ##LEVEL## state. \n\nThis began at ##START## -- or ##DURATION## ago.\n\nOnce memory pressure has exceeded 100% VMs will begin paging and performance will degrade. Consider relocating some running VMs to another host."}, {"name": "HealthStatus_Critical", "description": "count of machines in \"HealthCritical\" state", "interpretMethod": "regex", "interpretExpr": "HealthCritical\\s+:\\s+(\\d+)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HealthStatus_Ok", "description": "count of machines in \"HealthOk\" state", "interpretMethod": "regex", "interpretExpr": "HealthOk\\s+:\\s+(\\d+)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "lpPercentGuestRunTime", "description": "total percentage of time spent by the physical cpu cores running the guest operating systems", "interpretMethod": "regex", "interpretExpr": "PercentGuestRunTime\\s+:\\s+(\\d+)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "lpPercentHypervisorRunTime", "description": "total percentage of time spent by the physical cpu cores running the hypervisor", "interpretMethod": "regex", "interpretExpr": "PercentHypervisorRunTime\\s+:\\s+(\\d+)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "lpPercentTotalRunTime", "description": "total percentage of time spent by the physical cpu cores running both the hypervisor and all guest operating systems", "interpretMethod": "regex", "interpretExpr": "PercentTotalRunTime\\s+:\\s+(\\d+)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "> 70 90", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "The physical cpu core capacity on Hyper-V host ##HOST## is ##VALUE##, insufficient to carry the VM load, putting this device in a ##LEVEL## state.\n\nThis began at ##START## -- or ##DURATION## ago."}, {"name": "rvpPercentTotalRunTime", "description": "the percentage of time spent by the processor running the root partition, which is responsible for providing auxilliary services to VMs", "interpretMethod": "regex", "interpretExpr": "rvpPercentTotalRunTime\\s+:\\s+(\\d+)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "tvpPercentTotalRunTime", "description": "the percentage of time spent by the virtual processors running guest VMs", "interpretMethod": "regex", "interpretExpr": "tvpPercentTotalRunTime\\s+:\\s+(\\d+)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "> 80 90", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The virtual processor capacity on Hyper-V host ##HOST## is ##VALUE##, insufficient to carry the VM load, putting this device in a ##LEVEL## state. Consider allocating additional processors to virtual machines if there are available logical processors. \n\nThis started at ##START## -- or for ##DURATION##."}], "graphs": [{"name": "Available Memory", "title": "Available Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AvailableMemory", "datapointName": "AvailableMemory", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "AvailableMemoryBytes", "expr": "AvailableMemory * 1024 * 1024"}], "lines": [{"type": "stack", "legend": "AvailableMemoryBytes", "color": "fuchsia", "datapointName": "AvailableMemoryBytes", "isVirtual": true}]}, {"name": "Logical Processor Usage", "title": "Logical Processor Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PercentGuestRunTime", "datapointName": "lpPercentGuestRunTime", "consolidationFn": "average"}, {"name": "PercentHypervisorRunTime", "datapointName": "lpPercentHypervisorRunTime", "consolidationFn": "average"}, {"name": "PercentTotalRunTime", "datapointName": "lpPercentTotalRunTime", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Guest (VMs)", "color": "aqua", "datapointName": "PercentGuestRunTime", "isVirtual": false}, {"type": "stack", "legend": "Hypervisor (Management)", "color": "yellow", "datapointName": "PercentHypervisorRunTime", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "PercentTotalRunTime", "isVirtual": false}]}, {"name": "Memory Pressure", "title": "Memory Pressure", "verticalLabel": "%", "min": 0.0, "max": 120.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AveragePressure", "datapointName": "AveragePressure", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Average Pressure", "color": "gray", "datapointName": "AveragePressure", "isVirtual": false}]}, {"name": "Root Virtual Processor Usage", "title": "Root Virtual Processor Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "rvpPercentTotalRunTime", "datapointName": "rvpPercentTotalRunTime", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Root Partition CPU", "color": "purple", "datapointName": "rvpPercentTotalRunTime", "isVirtual": false}]}, {"name": "Total Virtual Processor Usage", "title": "Total Virtual Processor Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "tvpPercentTotalRunTime", "datapointName": "tvpPercentTotalRunTime", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "VM Total CPU", "color": "maroon", "datapointName": "tvpPercentTotalRunTime", "isVirtual": false}]}, {"name": "VM Count by Health State", "title": "VM Count by Health State", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "HealthCritical", "datapointName": "HealthStatus_Critical", "consolidationFn": "average"}, {"name": "HealthOk", "datapointName": "HealthStatus_Ok", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Health Critical", "color": "red", "datapointName": "HealthCritical", "isVirtual": false}, {"type": "stack", "legend": "Health Ok", "color": "green", "datapointName": "HealthOk", "isVirtual": false}]}]}

×DataSource: PaloAlto_FW_RunningConfigXML (2321)

{"name": "PaloAlto_FW_RunningConfigXML", "description": "The running configuration for paloalto firewalls in XML format", "appliesTo": "hasCategory(\"PaloAlto\") &&\npaloalto.apikey.pass", "searchKeywords": "firewall,network,hardware,paloalto", "technicalNotes": "- requires api key set in paloalto.apikey.pass\n- xml format suitable for restoring from backup", "displayedAs": "PanOS Config (XML)", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef host = hostProps.get(\"system.hostname\")\ndef apikey = hostProps.get(\"paloalto.apikey.pass\")?.trim()\nif (apikey == null) {\n println \"No paloalto.apikey.pass set\"\n return 1\n}\n\ndef output\ndef getRequestConn1 = \"https://${host}/esp/restapi.esp?type=config&action=show&key=${apikey}\".toURL().openConnection()\nif (getRequestConn1.responseCode == 200) {\n output = getRequestConn1.content.text\n}\n\nif (getRequestConn1.responseCode != 200 || !output?.contains('response status=\\\"success\\\"')) {\n getRequestConn2 = \"https://${host}/api/?type=config&action=show&key=${apikey}\".toURL().openConnection()\n if (getRequestConn2.responseCode == 200) {\n output = getRequestConn2.content.text \n if (!output?.contains('response status=\\\"success\\\"')) {\n println \"Queries failed. Unable to get config.\"\n return 1\n } \n } else {\n println \"Failed to GET https://${host}/api/?type=config&action=show\\nStatus code: ${getRequestConn2.responseCode}\"\n return 1\n }\n}\n\nprint ((output =~ /(?s)<result>(.*)<\\/result>/)[0][1])\n\nreturn 0"}, "configChecks": [{"name": "DifferenceTest", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 0}, "severity": "warn"}, {"name": "RetrievalTest", "description": "", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Cisco_EIGRP_AutonomousSystem (2174)

{"name": "Cisco_EIGRP_AutonomousSystem", "description": "Monitors EIGRP sent/received messages, packets, topology and queue.", "appliesTo": "isCisco()", "searchKeywords": "eigrp,cisco,network", "displayedAs": "EIGRP Autonomous System", "collectionInterval": "2m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\nimport org.xbill.DNS.*;\nimport org.apache.*\n\n// Properties\ndef hostName = hostProps.get(\"system.hostname\");\n\n// OID'S\ndef AS_OID = \".1.3.6.1.4.1.9.9.449.1.2.1.1.1\"\n\ndef RouterID_OID = \".1.3.6.1.4.1.9.9.449.1.2.1.1.18\"\n\n\nAS_walk = Snmp.walk(hostName,AS_OID)\nRouterID_walk = Snmp.walk(hostName,RouterID_OID)\n\nMap AS_map = [:]\nMap RouterID_map = [:]\n\n\nAS_walk.eachLine\n{ line ->\n\n regex_pattern = \"(${AS_OID})\" + /.(.*)\\s=\\s(.*)/;\n regex_match = ~regex_pattern\n line_match = regex_match.matcher(line)\n handle = line_match[0][2]\n val = line_match[0][3]\n\n AS_map.put(handle,val)\n}\n\n\nRouterID_walk.eachLine\n{ line ->\n\n regex_pattern = \"(${RouterID_OID})\" + /.(.*)\\s=\\s(.*)/;\n regex_match = ~regex_pattern\n line_match = regex_match.matcher(line)\n handle = line_match[0][2]\n val = line_match[0][3]\n\n RouterID_map.put(handle,val)\n}\n\nAS_map.each\n{ k,v ->\n\n if(RouterID_map.containsKey(k))\n {\n wildvalue = k.toString().replaceAll(/\\./,\"_\")\n println \"${wildvalue}##Autonomous System : ${v}##Router : ${val}\";\n }\n}\n\nreturn 0;"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\nimport org.xbill.DNS.*;\nimport org.apache.*\n\n// Properties\ndef hostName = hostProps.get(\"system.hostname\");\n\nMap OID_Map = [:]\nOID_Map[\"NbrCount\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.2\"\nOID_Map[\"HelloSent\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.3\"\nOID_Map[\"HelloReceived\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.4\"\nOID_Map[\"UpdatesSent\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.5\"\nOID_Map[\"UpdatesReceived\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.6\"\nOID_Map[\"QueriesSent\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.7\"\nOID_Map[\"QueriesReceived\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.8\"\nOID_Map[\"RepliesSent\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.9\"\nOID_Map[\"RepliesReceived\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.10\"\nOID_Map[\"AcksSent\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.11\"\nOID_Map[\"AcksReceived\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.12\"\nOID_Map[\"InputQHM\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.13\"\nOID_Map[\"InputQDrops\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.14\"\nOID_Map[\"SiaQueriesSent\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.15\"\nOID_Map[\"SiaQueriesReceived\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.15\"\nOID_Map[\"TopoRoutes\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.19\"\nOID_Map[\"XmitPendReplies\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.22\"\nOID_Map[\"XmitDummies\"] = \".1.3.6.1.4.1.9.9.449.1.2.1.1.23\"\n\n// Each OID in the map.\nOID_Map.each\n{ name,oid ->\n\n // walk each\n walk = Snmp.walk(hostName,oid)\n walk.eachLine()\n { line ->\n\n // find matching regex patterns.\n regex_pattern = \"(${oid})\" + /.(.*)\\s=\\s(.*)/;\n regex_match = ~regex_pattern\n line_match = regex_match.matcher(line)\n handle = line_match[0][2]\n val = line_match[0][3]\n wildvalue = handle.toString().replaceAll(/\\./,\"_\")\n\n // print everything out.\n println \"${wildvalue}.${name}=${val}\"\n }\n}\n\n\nreturn 0;"}, "datapoints": [{"name": "AcksReceived", "description": "The number packet acknowledgements that have been received per second from all EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured for the EIGRP AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.AcksReceived", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "AcksSent", "description": "The number packet acknowledgements that have been sent per second from all EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured for the EIGRP AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.AcksSent", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HelloReceived", "description": "The number Hello packets per second that have been received from all EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured for the EIGRP AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.HelloReceived", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HelloSent", "description": "The number Hello packets per second that have been sent from all EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured for the EIGRP AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.HelloSent", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "InputQDrops", "description": "The number of EIGRP packets dropped from the input queue due to it being full within the AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.InputQDrops", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The EIGRP Autonomous System ##INSTANCE## on ##HOST## has dropped ##VALUE## packets/sec from the input queue, placing the alert into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "NbrCount", "description": "The total number of live EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured in the EIGRP AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.NbrCount", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "QueriesReceived", "description": "The number of alternate route query packets per second that have been received from all EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured for the EIGRP AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.QueriesReceived", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "QueriesSent", "description": "The number of alternate route query packets per second that have been sent from all EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured for the EIGRP AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.QueriesSent", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RepliesReceived", "description": "The number of query reply packets per second that have been received from all EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured for the EIGRP AS", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.RepliesReceived", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RepliesSent", "description": "The number of query reply packets per second that have been sent from all EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured for the EIGRP AS", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.RepliesSent", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SiaQueriesReceived", "description": "The number of Stuck-In-Active (SIA) query packets received per second from all EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured for the EIGRP AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.SiaQueriesReceived", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SiaQueriesSent", "description": "The number of Stuck-In-Active (SIA) query packets sent per second from all EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured for the EIGRP AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.SiaQueriesSent", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TopoRoutes", "description": "The total number of EIGRP derived routes currently existing in the topology table for the AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.TopoRoutes", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UpdatesReceived", "description": "The number of routing update packets that have been received per second from all EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured for the EIGRP AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.UpdatesReceived", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UpdatesSent", "description": "The number of routing update packets that have been sent per second from all EIGRP neighbors formed on all interfaces whose IP addresses fall under networks configured for the EIGRP AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.UpdatesSent", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "XmitDummies", "description": "A dummy is a temporary internal entity used as a place holder in the topology table for an AS. They are not transmitted in routing updates. This is the total number currently in existence associated with the AS.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.XmitDummies", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "XmitPendReplies", "description": "This object is the total number of outstanding replies expected to queries that have been sent to peers in the current AS. It remains at zero most of the time until an EIGRP route becomes active. When alternate route query packets are sent to adjacent EIGRP peers in an AS, replies are expected.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.XmitPendReplies", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Dummies", "title": "Dummies", "verticalLabel": "count", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "XmitDummies", "datapointName": "XmitDummies", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Dummies", "color": "teal", "datapointName": "XmitDummies", "isVirtual": false}]}, {"name": "EIGRP Traffic", "title": "EIGRP Traffic", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AcksReceived", "datapointName": "AcksReceived", "consolidationFn": "average"}, {"name": "AcksSent", "datapointName": "AcksSent", "consolidationFn": "average"}, {"name": "HelloReceived", "datapointName": "HelloReceived", "consolidationFn": "average"}, {"name": "HelloSent", "datapointName": "HelloSent", "consolidationFn": "average"}, {"name": "QueriesReceived", "datapointName": "QueriesReceived", "consolidationFn": "average"}, {"name": "QueriesSent", "datapointName": "QueriesSent", "consolidationFn": "average"}, {"name": "RepliesReceived", "datapointName": "RepliesReceived", "consolidationFn": "average"}, {"name": "RepliesSent", "datapointName": "RepliesSent", "consolidationFn": "average"}, {"name": "SiaQueriesReceived", "datapointName": "SiaQueriesReceived", "consolidationFn": "average"}, {"name": "SiaQueriesSent", "datapointName": "SiaQueriesSent", "consolidationFn": "average"}, {"name": "UpdatesReceived", "datapointName": "UpdatesReceived", "consolidationFn": "average"}, {"name": "UpdatesSent", "datapointName": "UpdatesSent", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Acks", "expr": "AcksSent + AcksReceived"}, {"name": "Hellos", "expr": "HelloSent + HelloReceived"}, {"name": "Queries", "expr": "QueriesSent + QueriesReceived"}, {"name": "Replies", "expr": "RepliesSent + RepliesReceived"}, {"name": "SiaQueries", "expr": "SiaQueriesSent + SiaQueriesReceived"}, {"name": "Updates", "expr": "UpdatesSent + UpdatesReceived"}], "lines": [{"type": "line", "legend": "ACKs", "color": "orange", "datapointName": "Acks", "isVirtual": true}, {"type": "line", "legend": "Hellos", "color": "green", "datapointName": "Hellos", "isVirtual": true}, {"type": "line", "legend": "Queries", "color": "teal", "datapointName": "Queries", "isVirtual": true}, {"type": "line", "legend": "Replies", "color": "blue", "datapointName": "Replies", "isVirtual": true}, {"type": "line", "legend": "SIA Queries", "color": "fuchsia", "datapointName": "SiaQueries", "isVirtual": true}, {"type": "line", "legend": "Updates", "color": "maroon", "datapointName": "Updates", "isVirtual": true}]}, {"name": "Input Queue Drops", "title": "Input Queue Drops", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "InputQDrops", "datapointName": "InputQDrops", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Drops", "color": "red", "datapointName": "InputQDrops", "isVirtual": false}]}, {"name": "Neighbors", "title": "Neighbors", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "NbrCount", "datapointName": "NbrCount", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Neighbors", "color": "aqua", "datapointName": "NbrCount", "isVirtual": false}]}, {"name": "Pending Replies", "title": "Pending Replies", "verticalLabel": "count", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "XmitPendReplies", "datapointName": "XmitPendReplies", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Pending", "color": "purple", "datapointName": "XmitPendReplies", "isVirtual": false}]}, {"name": "Routes", "title": "Routes", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "TopoRoutes", "datapointName": "TopoRoutes", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Routes", "color": "olive", "datapointName": "TopoRoutes", "isVirtual": false}]}]}

×DataSource: Cisco_EIGRP_Interfaces (2175)

{"name": "Cisco_EIGRP_Interfaces", "description": "Monitors EIGRP interface metrics.", "appliesTo": "isCisco()", "searchKeywords": "eigrp,interface,cisco,network", "displayedAs": "EIGRP Interfaces", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.expect.Expect;\nimport com.santaba.agent.groovyapi.snmp.Snmp;\nimport com.santaba.agent.groovyapi.http.*;\nimport com.santaba.agent.groovyapi.jmx.*;\nimport org.xbill.DNS.*;\nimport org.apache.*\n\n// Properties\ndef hostName = hostProps.get(\"system.hostname\");\n\n// OID'S\ndef interfaces_OID = \".1.3.6.1.4.1.9.9.449.1.5.1.1.3\"\n\ninterfaces_walk = Snmp.walk(hostName,interfaces_OID)\n\n// Map of peer info.\n// def peerVersion_map = [:]\n\n\n// handles\ninterfaces_walk.eachLine\n{ line ->\n\n regex_pattern = \"(${interfaces_OID})\" + /.(.*)\\s=\\s(.*)/;\n regex_match = ~regex_pattern\n line_match = regex_match.matcher(line)\n\n handle = line_match[0][2]\n (index,id,interfaceNum) = handle.toString().tokenize(\".\")\n\n if(interfaceNum.toInteger() < 10)\n {\n println handle.toString().replaceAll(/\\./,\"_\") + \"##\" + \"Interface #0${interfaceNum}\";\n }\n else\n {\n println handle.toString().replaceAll(/\\./,\"_\") + \"##\" + \"Interface #${interfaceNum}\";\n }\n}\n\n\nreturn 0;"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.expect.Expect;\nimport com.santaba.agent.groovyapi.snmp.Snmp;\nimport com.santaba.agent.groovyapi.http.*;\nimport com.santaba.agent.groovyapi.jmx.*;\nimport org.xbill.DNS.*;\nimport org.apache.*\n\n// Properties\ndef hostName = hostProps.get(\"system.hostname\");\n\nMap OID_Map = [:]\nOID_Map[\"peerCount\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.3\"\nOID_Map[\"XmitReliableQ\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.4\"\nOID_Map[\"XmitUnreliableQ\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.5\"\nOID_Map[\"MeanSrtt\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.6\"\nOID_Map[\"PacingReliable\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.7\"\nOID_Map[\"PacingUnreliable\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.8\"\nOID_Map[\"PendingRoutes\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.10\"\nOID_Map[\"HelloInterval\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.11\"\nOID_Map[\"XmitNextSerial\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.12\"\nOID_Map[\"UMcasts\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.13\"\nOID_Map[\"RMcasts\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.14\"\nOID_Map[\"UUcasts\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.15\"\nOID_Map[\"RUcasts\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.16\"\nOID_Map[\"McastExcepts\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.17\"\nOID_Map[\"CRpkts\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.18\"\nOID_Map[\"AcksSuppressed\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.19\"\nOID_Map[\"RetransSent\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.20\"\nOID_Map[\"OOSrvcd\"] = \".1.3.6.1.4.1.9.9.449.1.5.1.1.21\"\n\n// Each OID in the map.\nOID_Map.each\n{ name,oid ->\n\n // walk each\n walk = Snmp.walk(hostName,oid)\n walk.eachLine()\n { line ->\n\n // find matching regex patterns.\n regex_pattern = \"(${oid})\" + /.(.*)\\s=\\s(.*)/;\n regex_match = ~regex_pattern\n line_match = regex_match.matcher(line)\n handle = line_match[0][2]\n val = line_match[0][3]\n wildvalue = handle.toString().replaceAll(/\\./,\"_\")\n\n // print everything out.\n println \"${wildvalue}.${name}=${val}\"\n }\n}\n\n\nreturn 0;"}, "datapoints": [{"name": "AcksSuppressed", "description": "The number of individual EIGRP acknowledgement packets per second that have been suppressed and combined in an already enqueued outbound reliable packet on this interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.AcksSuppressed", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CRpkts", "description": "Number of EIGRP Conditional-Receive packets sent per second on this interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CRpkts", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "McastExcepts", "description": "Number of EIGRP multicast exception transmissions per second that have occurred on this interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.McastExcepts", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MeanSrtt", "description": "The average of all the computed smooth round trip time values for a packet to and from all peers established on this interface (ms)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.MeanSrtt", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OOSrvcd", "description": "Number of out-of-sequence EIGRP packets received per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.OOSrvcd", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PendingRoutes", "description": "The number of queued EIGRP routing updates awaiting transmission on this interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.PendingRoutes", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RMcasts", "description": "Number of reliable (acknowledgement required) EIGRP multicast packets sent per second on this interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.RMcasts", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RUcasts", "description": "Number of reliable (acknowledgement required) unicast packets sent per second on this interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.RUcasts", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RetransSent", "description": "Number of EIGRP packet retransmissions sent per second on the interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.RetransSent", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UMcasts", "description": "Number of unreliable (no acknowledgement required) EIGRP multicast packets sent per second on this interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.UMcasts", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UUcasts", "description": "Number of unreliable (no acknowledgement required) EIGRP unicast packets sent per second on this interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.UUcasts", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "XmitReliableQ", "description": "The number of EIGRP packets currently waiting in the reliable transport (acknowledgement-required) transmission queue to be sent to a peer.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.XmitReliableQ", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "XmitUnreliableQ", "description": "The number EIGRP of packets currently waiting in the unreliable transport (no acknowledgement required) transmission queue.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.XmitUnreliableQ", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "peerCount", "description": "The number of EIGRP adjacencies currently formed with peers reached through this interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.peerCount", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "ACK Suppression", "title": "ACK Suppression", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AcksSuppressed", "datapointName": "AcksSuppressed", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Suppressed", "color": "red", "datapointName": "AcksSuppressed", "isVirtual": false}]}, {"name": "Multicast Exceptions", "title": "Multicast Exceptions", "verticalLabel": "transmissions/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "McastExcepts", "datapointName": "McastExcepts", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": " Transmissions", "color": "orange", "datapointName": "McastExcepts", "isVirtual": false}]}, {"name": "Packet Statistics", "title": "Packet Statistics", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CRpkts", "datapointName": "CRpkts", "consolidationFn": "average"}, {"name": "McastExcepts", "datapointName": "McastExcepts", "consolidationFn": "average"}, {"name": "OOSrvcd", "datapointName": "OOSrvcd", "consolidationFn": "average"}, {"name": "RMcasts", "datapointName": "RMcasts", "consolidationFn": "average"}, {"name": "RUcasts", "datapointName": "RUcasts", "consolidationFn": "average"}, {"name": "UMcasts", "datapointName": "UMcasts", "consolidationFn": "average"}, {"name": "UUcasts", "datapointName": "UUcasts", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Sent Conditional-Receive", "color": "lime", "datapointName": "CRpkts", "isVirtual": false}, {"type": "line", "legend": "Received Out-of-Sequence ", "color": "red", "datapointName": "OOSrvcd", "isVirtual": false}, {"type": "line", "legend": "Reliable Multicast", "color": "orange", "datapointName": "RMcasts", "isVirtual": false}, {"type": "line", "legend": "Reliable Unicast", "color": "green", "datapointName": "RUcasts", "isVirtual": false}, {"type": "line", "legend": "Unreliable Multicast", "color": "teal", "datapointName": "UMcasts", "isVirtual": false}, {"type": "line", "legend": "Unreliable Unicast", "color": "black", "datapointName": "UUcasts", "isVirtual": false}]}, {"name": "Peers", "title": "Peers", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "peerCount", "datapointName": "peerCount", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Peers", "color": "olive", "datapointName": "peerCount", "isVirtual": false}]}, {"name": "Queued Routing Updates", "title": "Queued Routing Updates", "verticalLabel": "routing updates", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PendingRoutes", "datapointName": "PendingRoutes", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Routes", "color": "orange", "datapointName": "PendingRoutes", "isVirtual": false}]}, {"name": "Retransmissions", "title": "Retransmissions", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "RetransSent", "datapointName": "RetransSent", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Packets", "color": "lime", "datapointName": "RetransSent", "isVirtual": false}]}, {"name": "Smooth Round Trip Time", "title": "Smooth Round Trip Time", "verticalLabel": "ms", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SRTT", "datapointName": "MeanSrtt", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "SRTT", "color": "blue", "datapointName": "SRTT", "isVirtual": false}]}, {"name": "Transmission Queue", "title": "Transmission Queue", "verticalLabel": "packets", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "XmitReliableQ", "datapointName": "XmitReliableQ", "consolidationFn": "average"}, {"name": "XmitUnreliableQ", "datapointName": "XmitUnreliableQ", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Reliable", "color": "teal", "datapointName": "XmitReliableQ", "isVirtual": false}, {"type": "line", "legend": "Unreliable", "color": "red", "datapointName": "XmitUnreliableQ", "isVirtual": false}]}]}

×DataSource: Cisco_EIGRP_Topology (2173)

{"name": "Cisco_EIGRP_Topology", "description": "Monitors EIGRP routes, origins, successors, active/stuck-in-active and distance.", "appliesTo": "isCisco()", "searchKeywords": "eigrp,cisco,network", "displayedAs": "EIGRP Topology", "collectionInterval": "2m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\nimport org.xbill.DNS.*;\nimport org.apache.*\n\n// Properties\ndef hostName = hostProps.get(\"system.hostname\");\n\n// OID'S\ndef active_OID = \".1.3.6.1.4.1.9.9.449.1.3.1.1.2\"\ndef originaddr_OID = \".1.3.6.1.4.1.9.9.449.1.3.1.1.11\"\ndef nexthopAddr_OID = \".1.3.6.1.4.1.9.9.449.1.3.1.1.13\"\ndef nexthopIf_OID = \".1.3.6.1.4.1.9.9.449.1.3.1.1.14\"\n\n// Setup SNMP Walks\nactive_walk = Snmp.walk(hostName,active_OID)\noriginaddr_walk = Snmp.walk(hostName,originaddr_OID)\nnexthopadd_walk = Snmp.walk(hostName,nexthopAddr_OID)\nnexthopIf_walk = Snmp.walk(hostName,nexthopIf_OID)\n\n// Maps to store each SNMP walk result.\nMap active_map = [:]\nMap origin_addr_map = [:]\nMap nexthop_addr_map = [:]\nMap nexthope_if_map = [:]\n\n// Active\nactive_walk.eachLine\n{ line ->\n\n regex_pattern = \"(${active_OID})\" + /.(.*)\\s=\\s(.*)/;\n regex_match = ~regex_pattern\n line_match = regex_match.matcher(line)\n wildvalue = (line_match[0][2]).toString().replaceAll(/\\./,\"_\")\n val = line_match[0][3]\n\n active_map.put(wildvalue,val)\n}\n\n// origin address\noriginaddr_walk.eachLine\n{ line ->\n\n regex_pattern = \"(${originaddr_OID})\" + /.(.*)\\s=\\s(.*)/;\n regex_match = ~regex_pattern\n line_match = regex_match.matcher(line)\n wildvalue = (line_match[0][2]).toString().replaceAll(/\\./,\"_\")\n val = line_match[0][3]\n\n origin_addr_map.put(wildvalue,val)\n}\n\n// next hop address\nnexthopadd_walk.eachLine\n{ line ->\n\n regex_pattern = \"(${nexthopAddr_OID})\" + /.(.*)\\s=\\s(.*)/;\n regex_match = ~regex_pattern\n line_match = regex_match.matcher(line)\n wildvalue = (line_match[0][2]).toString().replaceAll(/\\./,\"_\")\n val = line_match[0][3]\n\n nexthop_addr_map.put(wildvalue,val)\n}\n\n// next hop interfaces\nnexthopIf_walk.eachLine\n{ line ->\n\n regex_pattern = \"(${nexthopIf_OID})\" + /.(.*)\\s=\\s(.*)/;\n regex_match = ~regex_pattern\n line_match = regex_match.matcher(line)\n wildvalue = (line_match[0][2]).toString().replaceAll(/\\./,\"_\")\n val = line_match[0][3]\n\n nexthope_if_map.put(wildvalue,val)\n}\n\n// Iterate throuh each active path instance\nactive_map.each\n{ wildvalue,val ->\n\n originAddr = origin_addr_map[wildvalue];\n nexthopAddr = nexthop_addr_map[wildvalue];\n nexthopIf = nexthope_if_map[wildvalue];\n\n // Print it out.\n println \"${wildvalue}##${val}##Origin : ${originAddr}, Next-Hop : ${nexthopAddr}, Interface : ${nexthopIf}\";\n}\n\n\nreturn 0;"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\nimport org.xbill.DNS.*;\nimport org.apache.*\n\n// Properties\ndef hostName = hostProps.get(\"system.hostname\");\n\nMap OID_Map = [:]\nOID_Map[\"Active\"] = \".1.3.6.1.4.1.9.9.449.1.3.1.1.5\"\nOID_Map[\"SIA\"] = \".1.3.6.1.4.1.9.9.449.1.3.1.1.6\"\nOID_Map[\"FDistance\"] = \".1.3.6.1.4.1.9.9.449.1.3.1.1.8\"\nOID_Map[\"Distance\"] = \".1.3.6.1.4.1.9.9.449.1.3.1.1.15\"\nOID_Map[\"ReportDistance\"] = \".1.3.6.1.4.1.9.9.449.1.3.1.1.16\"\n\n\n// Each OID in the map.\nOID_Map.each\n{ name,oid ->\n\n // walk each\n walk = Snmp.walk(hostName,oid)\n walk.eachLine()\n { line ->\n\n // find matching regex patterns.\n regex_pattern = \"(${oid})\" + /.(.*)\\s=\\s(.*)/;\n regex_match = ~regex_pattern\n line_match = regex_match.matcher(line)\n handle = line_match[0][2]\n val = line_match[0][3]\n wildvalue = handle.toString().replaceAll(/\\./,\"_\")\n\n // print everything out.\n println \"${wildvalue}.${name}=${val}\"\n }\n}\n\nreturn 0;"}, "datapoints": [{"name": "Active", "description": "Indicates if the route is stable and active: 1=Failed (Query for alternate path in progress), 2=Stable", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Active", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "!= 2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The EIGRP Route ##INSTANCE## on ##HOST## has reported a failed state and is now in progress of another route. This places the device in a ##LEVEL## state.\n\nThis started at ##START## -- or ##DURATION## ago."}, {"name": "Distance", "description": "The computed distance to the destination network entry from this router.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Distance", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "FDistance", "description": "The feasibility (best) distance is the minimum distance from this router to the destination IP network in this topology entry. The feasibility distance is used in determining the best successor for a path to the destination network.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.FDistance", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ReportDistance", "description": "The computed distance to the destination network in the topology entry reported to this router by the originator of this route.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ReportDistance", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SIA", "description": "Measures Stuck-in-Active status: 1=Stuck-In-Active, 2=Stable. SIA indicates that this (active) route has not received any replies to queries for alternate paths, and a second EIGRP route query -- called a stuck-in-active query -- has now been sent.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.SIA", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "!= 2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The EIGRP route ##INSTANCE## on ##HOST## is in the Stuck In Active state. This means the router is involved in a diffusing computation for a new path to some network, and this computation seems to be stalled because some expected replies have not arrived in a reasonable time. \n\nThis may be caused by overloaded links or overutilized CPUs -- consider investigating.\n\nThis started at ##START## -- or ##DURATION## ago."}], "graphs": [{"name": "Distance", "title": "Distance", "verticalLabel": "hops", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Distance", "datapointName": "Distance", "consolidationFn": "average"}, {"name": "FDistance", "datapointName": "FDistance", "consolidationFn": "average"}, {"name": "ReportDistance", "datapointName": "ReportDistance", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Computed Distance", "color": "lime", "datapointName": "Distance", "isVirtual": false}, {"type": "line", "legend": "Feasible Distance", "color": "orange", "datapointName": "FDistance", "isVirtual": false}, {"type": "line", "legend": "Reported Distance", "color": "blue", "datapointName": "ReportDistance", "isVirtual": false}]}, {"name": "Stuck-in-Active", "title": "Stuck-in-Active", "verticalLabel": "1=Stuck-In-Active, 2=Stable", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SIA", "datapointName": "SIA", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Stuck-in-Active Status", "color": "red", "datapointName": "SIA", "isVirtual": false}]}, {"name": "Topology State", "title": "Topology State", "verticalLabel": "1=failed, 2=stable", "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Active", "datapointName": "Active", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Active", "color": "blue", "datapointName": "Active", "isVirtual": false}]}], "overviewGraphs": [{"name": "Topology State Overview", "title": "Topology State Overview", "verticalLabel": "1=failed, 2=stable", "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Active", "datapointName": "Active", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "Active", "isVirtual": false}]}]}

×DataSource: Citrix_Netscaler_FullBackup (2335)

{"name": "Citrix_Netscaler_FullBackup", "description": "Performs what Citrix considers a full backup of a NetScaler device.", "appliesTo": "(hasCategory(\"Netscaler\") || hasCategory(\"NetScalersActive\")) &&\nssh.user &&\nssh.pass", "searchKeywords": "netscaler,citrix,network,hardware", "technicalNotes": "- requires ssh access via credentials set in ssh.user and ssh.pass\n- Command Policy configured that permits specific shell commands by the ssh.user account (specifically the \"FIND\" and \"CAT\" commands).", "displayedAs": "NetScaler Config Full Backup", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 2, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.groovyapi.expect.Expect\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\")\ndef pass = hostProps.get(\"ssh.pass\")\ndef port = hostProps.get(\"ssh.port\") ?: 22\n\ndef paths = [\"/nsconfig/ns.conf\",\n \"/nsconfig/ZebOS.conf\",\n \"/nsconfig/rc.netscaler\",\n \"/nsconfig/snmpd.conf\",\n \"/nsconfig/nsbefore.sh\",\n \"/nsconfig/nsafter.sh\",\n \"/nsconfig/inetd.conf\",\n \"/nsconfig/ntp.conf\",\n \"/nsconfig/syslog.conf\",\n \"/nsconfig/newsyslog.conf\",\n \"/nsconfig/crontab\",\n \"/nsconfig/host.conf\",\n \"/nsconfig/hosts\",\n \"/nsconfig/ttys\",\n \"/nsconfig/sshd_config\",\n \"/nsconfig/httpd.conf\",\n \"/nsconfig/monitrc\",\n \"/nsconfig/rc.conf\",\n \"/nsconfig/ssh_config\",\n \"/nsconfig/localtime\",\n \"/nsconfig/issue\",\n \"/nsconfig/issue.net\",\n \"/nsconfig/ssl/\",\n \"/nsconfig/license/\",\n \"/nsconfig/fips/\",\n \"/var/download/\",\n \"/var/log/wicmd.log\",\n \"/var/wi/tomcat/webapps/\",\n \"/var/wi/tomcat/logs/\",\n \"/var/wi/tomcat/conf/catalina/localhost/\",\n \"/var/nslw.bin/etc/krb.conf\",\n \"/var/nslw.bin/etc/krb.keytab\",\n \"/var/netscaler/locdb/\",\n \"/var/lib/likewise/db/\",\n \"/var/vpn/bookmark/\",\n \"/var/netscaler/crl\",\n \"/var/nstemplates/\",\n \"/var/learnt_data/\",\n \"/var/netscaler/ssl/\",\n \"/var/wi/java_home/jre/lib/security/cacerts/\",\n \"/var/wi/java_home/lib/security/cacerts/\",\n \"/netscaler/custom.html\",\n \"/netscaler/vsr.htm\"]\n\ndef cli\ndef timeout = 10\ndef success = false\ndef error = \"\"\n\ndef termClean = /(.\\[\\?7h)/\ndef rawPrompt = /^(?-m)[^\\n]*[>#$]\\s*$/\n\ndef retries = 0\n\nwhile (retries < 10 && !success) {\n try {\n cli = Expect.open(host, port.toInteger(), user, pass, timeout)\n cli.expect(\".\")\n success = true\n }\n catch (ex) {\n sleep(1000)\n error += \"[Connection Attempt ${retries}] ${ex.message}\\n\"\n }\n\n retries++\n}\n\nif (success) {\n try {\n def outputStability = 0\n def lastLength = -1\n\n while (outputStability < 10) {\n outputStability += (cli.stdout().length() == lastLength) ? 1 : -outputStability\n lastLength = cli.stdout().length()\n sleep(10)\n }\n\n cli.expect(rawPrompt)\n def prompt = \"^.?${cli.matched().replaceAll(termClean, '').trim().replaceAll(/[.*+?^()|\\[\\]\\\\{}$]/, '\\\\\\\\$0')}\"\n\n paths.each { path ->\n cli.send(\"shell find ${path} -type f\\n\")\n cli.expect(prompt)\n cli.before().eachLine { line ->\n if (line.startsWith('/')) {\n println \"${line}##${line}\"\n }\n }\n }\n } catch (ex) {\n error += \"[Collecting] ${ex.message}\\n\"\n success = false\n }\n\n try {\n cli.send(\"exit\\n\")\n cli.close()\n }\n catch (ex) {\n error += \"[Closing] ${ex.message}\\n\"\n success = false\n }\n}\n\nif (!success) {\n println \"--- Error Logs ---\\n${error}\"\n println cli ? \"--- CLI Output ---\\n${cli.stdout()}\" : \"\"\n return 1\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.groovyapi.expect.Expect\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\")\ndef pass = hostProps.get(\"ssh.pass\")\ndef port = hostProps.get(\"ssh.port\") ?: 22\ndef wild = instanceProps.get(\"wildvalue\")\n\ndef cli\ndef timeout = 60\ndef success = false\ndef error = \"\"\n\ndef termClean = /(.\\[\\?7h)/\ndef rawPrompt = /^(?-m)[^\\n]*[>#$]\\s*$/\n\ndef retries = 0\n\nwhile (retries < 10 && !success) {\n try {\n cli = Expect.open(host, port.toInteger(), user, pass, timeout)\n cli.expect(\".\")\n success = true\n }\n catch (ex) {\n sleep(1000)\n error += \"[Connection Attempt ${retries}] ${ex.message}\\n\"\n }\n\n retries++\n}\n\nif (success) {\n try {\n def outputStability = 0\n def lastLength = -1\n\n while (outputStability < 10) {\n outputStability += (cli.stdout().length() == lastLength) ? 1 : -outputStability\n lastLength = cli.stdout().length()\n sleep(10)\n }\n\n cli.expect(rawPrompt)\n def prompt = \"^.?${cli.matched().replaceAll(termClean, '').trim().replaceAll(/[.*+?^()|\\[\\]\\\\{}$]/, '\\\\\\\\$0')}\"\n\n\t\tcli.send(\"shell cat '${wild}'\\n\")\n\n cli.expect(prompt)\n\n def output = cli.before()\n\t\tdef filteredOutput = output.trim().readLines().drop(1).join('\\n').replaceAll(/^(shell)?\\s*cat\\s*:?\\s*\\Q${wild}\\E\\s*/, \"\").replaceAll(/Done$/, \"\").trim()\n\n\t\tif(output.contains(\"Done\")) {\n \tprintln filteredOutput\n\t\t} else {\n\t\t\tsuccess = false;\n\t\t}\n } catch (ex) {\n error += \"[Collecting] ${ex.message}\\n\"\n success = false\n }\n\n try {\n cli.send(\"exit\\n\")\n cli.close()\n }\n catch (ex) {\n error += \"[Closing] ${ex.message}\\n\"\n success = false\n }\n}\n\nif (!success) {\n error += cli ? \"--- CLI Output ---\\n${cli.stdout()}\\n\" : \"\"\n error += cli ? \"--- CLI Base64 ---\\n${cli.stdout().bytes.encodeBase64().toString()}\\n\" : \"\"\n println \"--- Error Logs ---\\n${error}\"\n new File(\"../logs/Citrix_Netscaler_${host.replaceAll('[^a-zA-Z0-9-_\\\\.]', '_')}_${wild.replaceAll('[^a-zA-Z0-9-_\\\\.]', '_')}.txt\").write(error)\n return 1\n}\n\nreturn 0"}, "configChecks": [{"name": "DifferenceTest", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": ["Done", "shell cat"], "ignoreSpaces": false, "ignoreBlank": true}, "clearAfterAck": false, "clearAfterMin": 0}, "severity": "warn"}, {"name": "RetrievalTest", "description": "", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Nutanix_VirtualMachines (1145)

{"name": "Nutanix_VirtualMachines", "description": "Monitors the individual virtual machines currently being hosted on the Nutanix Cluster, monitoring IOPS, bandwidth, CPU utilization, latency and power state.", "appliesTo": "hasCategory(\"NutanixCluster\")", "searchKeywords": "virtual machine,hyperconvergence,vm,storage,nutanix", "technicalNotes": "Enable SNMP: https://portal.nutanix.com/#/page/docs/details?targetId=Web-Console-Guide-Prism-v50:wc-system-snmp-wc-t.html\n- There is a known bug in VMware/Nutanix which causes 100% memory utilization on VM's with any one of following options: \n- PCI passthrough devices\n- Fault Tolerance (FT) enabled\n- Latency Sensitivity set to High\n- vGPU enabled\n\n- https://kb.vmware.com/s/article/2149787\n- https://portal.nutanix.com/#/page/kbs/details?targetId=kA032000000bmXECAY", "displayedAs": "Nutanix Virtual Machines", "collectionInterval": "2m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname')\ndef props = hostProps.toProperties()\ndef timeout = 60000 // 60 sec timeout.\n\n// define maps we will walk.\ndef hypervisorID = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41263.9.1.2\", props, timeout)\ndef hypervisorName = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41263.9.1.3\", props, timeout)\n\ndef vmName = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41263.10.1.3\", props, timeout)\ndef vmHypervisorID = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41263.10.1.4\", props, timeout)\n\nMap hypervisorMap = [:]\n\nhypervisorID.each { hypervisor_index, hypervisor_id ->\n\n def converted_id = convert_to_ascii(hypervisor_id)\n def converted_name = convert_to_ascii(hypervisorName[hypervisor_index])\n\n hypervisorMap.put(converted_id, converted_name)\n}\n\nvmName.each { vm_index, vm_name ->\n\n def vm_hypervisor = hypervisorMap[convert_to_ascii(vmHypervisorID[vm_index])] ?: 'No_Hypervisor'\n\n def wildvalue = \"${vm_hypervisor}|${convert_to_ascii(vm_name)}\".toString().replaceAll(' ', '')\n\n println \"${wildvalue}##${convert_to_ascii(vm_name)}######\" +\n \"auto.nutanix.vm.hypervisor=${vm_hypervisor.toString().replaceAll('_', ' ')}\"\n}\n\n\n// execution was successful, return 0;\nreturn 0\n\n\n/**\n * Nutanix likes to return string content in hex. This will take that output and convert it to ascii.\n * The input looks like: 4c:aa:01:67\n * If it is not hex, return raw_string input\n */\ndef convert_to_ascii(String raw_string) {\n\n def result = \"\"\n\n if (raw_string.toString().contains(':')) {\n // take the hex value and split it at the \":\" separator.\n def hex_array = raw_string.split(\":\")\n\n // every hex string has ended with a \"00\", which is a \".\" in ascii. So every single converted hex string had a trailing \".\"\n // This removes that trailing \".\"\n hex_array = hex_array[0..(hex_array.length - 2)]\n\n // Iterate through the array, converting each hex value to ascii, and then to a character, followed by appending\n // that value to a result string.\n hex_array.each { character ->\n\n char ch = (char) (new BigInteger(character, 16))\n result += ch\n\n }\n } else {\n result = raw_string\n }\n\n return result\n}\n\n/**\n * Helper method to convert Kilobytes to bytes.\n */\ndef convert_KBps_to_Bps(BigInteger value_in_KBps) {\n\n return (value_in_KBps * 1024)\n\n}"}, "groupMethod": "ilp", "groupExpr": "auto.nutanix.vm.hypervisor"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname')\ndef props = hostProps.toProperties()\ndef timeout = 60000 // 60 sec timeout.\n\n// define maps we will walk.\ndef hypervisorID = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41263.9.1.2\", props, timeout)\ndef hypervisorName = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41263.9.1.3\", props, timeout)\n\ndef vmName = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41263.10.1.3\", props, timeout)\ndef vminformationtable = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41263.10.1\", props, timeout)\n\nMap map_vminfo_oids = [\"5\" : \"vmPowerState\",\n \"6\" : \"vmCpuCount\",\n \"7\" : \"vmCpuUsagePercentage\",\n \"8\" : \"vmMemory\",\n \"9\" : \"vmMemoryUsagePercentage\",\n \"10\": \"vmReadIOPerSecond\",\n \"11\": \"vmWriteIOPerSecond\",\n \"12\": \"vmAverageLatency\",\n \"13\": \"vmIOBandwidth\",\n \"14\": \"vmRxBytes\",\n \"15\": \"vmTxBytes\",\n \"16\": \"vmRxDropCount\",\n \"17\": \"vmTxDropCount\"]\n\nMap map_vmPowerState = [\"off\": \"0\",\n \"on\" : \"1\"]\n\nMap hypervisorMap = [:]\n\nhypervisorID.each { hypervisor_index, hypervisor_id ->\n\n def converted_id = convert_to_ascii(hypervisor_id)\n def converted_name = convert_to_ascii(hypervisorName[hypervisor_index])\n\n hypervisorMap.put(converted_id, converted_name)\n}\n\nvmName.each { vm_index, vm_name ->\n\n def vmHypervisorID = convert_to_ascii(vminformationtable[\"4.${vm_index}\"])\n\n def vm_hypervisor = hypervisorMap[vmHypervisorID] ?: 'No_Hypervisor'\n\n def wildvalue = \"${vm_hypervisor}|${convert_to_ascii(vm_name)}\".toString().replaceAll(' ', '')\n\n map_vminfo_oids.each { oid, counter_name ->\n\n if (counter_name.contains('PowerState')) {\n println \"${wildvalue}.${counter_name}=\" + map_vmPowerState[convert_to_ascii(vminformationtable[\"${oid}.${vm_index}\"]).toString()]\n } else if (counter_name.contains('IOBandwidth')) {\n println \"${wildvalue}.${counter_name}=\" + convert_KBps_to_Bps(vminformationtable[\"${oid}.${vm_index}\"].toBigInteger())\n } else {\n println \"${wildvalue}.${counter_name}=\" + vminformationtable[\"${oid}.${vm_index}\"]\n }\n }\n}\n\n// execution was successful, return 0;\nreturn 0\n\n\n/**\n * Nutanix likes to return string content in hex. This will take that output and convert it to ascii.\n * The input looks like: 4c:aa:01:67\n * If it is not hex, return raw_string input\n */\ndef convert_to_ascii(String raw_string) {\n\n def result = \"\"\n\n if (raw_string.toString().contains(':')) {\n // take the hex value and split it at the \":\" separator.\n def hex_array = raw_string.split(\":\")\n\n // every hex string has ended with a \"00\", which is a \".\" in ascii. So every single converted hex string had a trailing \".\"\n // This removes that trailing \".\"\n hex_array = hex_array[0..(hex_array.length - 2)]\n\n // Iterate through the array, converting each hex value to ascii, and then to a character, followed by appending\n // that value to a result string.\n hex_array.each { character ->\n\n char ch = (char) (new BigInteger(character, 16))\n result += ch\n\n }\n } else {\n result = raw_string\n }\n\n return result\n}\n\n/**\n * Helper method to convert Kilobytes to bytes.\n */\ndef convert_KBps_to_Bps(BigInteger value_in_KBps) {\n\n return (value_in_KBps * 1024)\n}"}, "datapoints": [{"name": "vmAverageLatency", "description": "Average I/O latency, in microseconds, of the VM.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmAverageLatency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "vmCpuCount", "description": "Total number of CPU's allocated to the VM.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmCpuCount", "useValue": "output", "type": "gauge", "dataType": 7, "min": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "vmCpuUsagePercentage", "description": "Percent CPU usage on the VM.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmCpuUsagePercentage", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": ">= 85 95", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "Nutanix VM ##INSTANCE## on ##HOST## is reporting a CPU utilization of ##VALUE## %, placing the VM into ##LEVEL## state.\n\nThis started at ##START## -- or ##DURATION## ago."}, {"name": "vmIOBandwidth", "description": "I/O bandwidth, in bytes/sec, on the VM.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmIOBandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "vmLatency_milliseconds", "description": "Average I/O latency, in milliseconds, on the VM.", "interpretMethod": "expression", "interpretExpr": "vmAverageLatency / 1000", "type": "gauge", "dataType": 7, "threshold": ">= 500 1000", "noData": "Do not trigger an alert", "triggerInterval": 4, "clearInterval": 0, "alertBody": "Nutanix VM ##INSTANCE## on ##HOST## is reporting an average I/O latency of ##VALUE## milliseconds, placing the device into ##LEVEL## state.\n\nThis started at ##START## -- or ##DURATION## ago."}, {"name": "vmMemory", "description": "Total memory, in bytes, available on the VM.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmMemory", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "vmMemoryUsage", "description": "Amount of memory used, in bytes, on the VM.", "interpretMethod": "expression", "interpretExpr": "( (vmMemoryUsagePercentage * 0.01) * vmMemory )", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "vmMemoryUsagePercentage", "description": "Percent memory utilization on the VM.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmMemoryUsagePercentage", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "> 95 98", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Nutanix VM ##INSTANCE## on ##HOST## is reporting that its memory utilization is at ##VALUE##%, placing the VM into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago.\n\n*Note* - There is a known bug in VMware/Nutanix which causes 100% memory utilization on VM's with any of following options configured: \n- PCI passthrough devices\n- Fault Tolerance (FT) enabled\n- Latency Sensitivity set to High\n- vGPU enabled\n\n- https://kb.vmware.com/s/article/2149787\n- https://portal.nutanix.com/#/page/kbs/details?targetId=kA032000000bmXECAY\n\nBy manufacturer recommendations, disable memory alerting on any VM's which match the above criteria as to best match VMware/Nutanix best practices and resolutions for this issue."}, {"name": "vmPowerState", "description": "Current power state of the VM.\n\nStatus Codes:\n0=Off,\n1=On", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmPowerState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "vmReadIOPerSecond", "description": "Number of read I/O operations served, per second, on this VM.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmReadIOPerSecond", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "vmRxBytes", "description": "Number of bytes received, per second, on the VM since the last polling interval.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmRxBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "vmRxDropCount", "description": "Number of receive packets dropped, per second, on the VM.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmRxDropCount", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "vmTxBytes", "description": "Number of bytes transmitted, per second, on the VM since the last polling interval.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmTxBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "vmTxDropCount", "description": "Number of transmitted packets dropped, per second, on the VM.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmTxDropCount", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "vmWriteIOPerSecond", "description": "Number of write I/O operations served, per second, on this VM.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vmWriteIOPerSecond", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "CPU Utilization", "title": "CPU Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "vmCpuUsagePercentage", "datapointName": "vmCpuUsagePercentage", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilized", "color": "orange2", "datapointName": "vmCpuUsagePercentage", "isVirtual": false}]}, {"name": "Memory Detail", "title": "Memory Detail", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "vmMemory", "datapointName": "vmMemory", "consolidationFn": "average"}, {"name": "vmMemoryUsage", "datapointName": "vmMemoryUsage", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "memoryFree", "expr": "vmMemory-vmMemoryUsage"}], "lines": [{"type": "stack", "legend": "Free", "color": "olive", "datapointName": "memoryFree", "isVirtual": true}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "vmMemory", "isVirtual": false}, {"type": "stack", "legend": "Used", "color": "red1", "datapointName": "vmMemoryUsage", "isVirtual": false}]}, {"name": "Memory Utilization", "title": "Memory Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "vmMemoryUsagePercentage", "datapointName": "vmMemoryUsagePercentage", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilized", "color": "fuchsia", "datapointName": "vmMemoryUsagePercentage", "isVirtual": false}]}, {"name": "Network Packet Drops", "title": "Network Packet Drops", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "vmRxDropCount", "datapointName": "vmRxDropCount", "consolidationFn": "average"}, {"name": "vmTxDropCount", "datapointName": "vmTxDropCount", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Inbound", "color": "red1", "datapointName": "vmRxDropCount", "isVirtual": false}, {"type": "stack", "legend": "Outbound", "color": "orange", "datapointName": "vmTxDropCount", "isVirtual": false}]}, {"name": "Network Throughput", "title": "Network Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "vmRxBytes", "datapointName": "vmRxBytes", "consolidationFn": "average"}, {"name": "vmTxBytes", "datapointName": "vmTxBytes", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Inbound", "color": "blue", "datapointName": "vmRxBytes", "isVirtual": false}, {"type": "stack", "legend": "Outbound", "color": "green", "datapointName": "vmTxBytes", "isVirtual": false}]}, {"name": "VM CPU Count", "title": "VM CPU Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "vmCpuCount", "datapointName": "vmCpuCount", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "CPUs", "color": "maroon", "datapointName": "vmCpuCount", "isVirtual": false}]}, {"name": "VM Power State", "title": "VM Power State", "verticalLabel": "0 = off, 1 = on", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "vmPowerState", "datapointName": "vmPowerState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Power State", "color": "blue", "datapointName": "vmPowerState", "isVirtual": false}]}, {"name": "vDisk IOPS", "title": "vDisk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "vmReadIOPerSecond", "datapointName": "vmReadIOPerSecond", "consolidationFn": "average"}, {"name": "vmWriteIOPerSecond", "datapointName": "vmWriteIOPerSecond", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Read", "color": "blue", "datapointName": "vmReadIOPerSecond", "isVirtual": false}, {"type": "line", "legend": "Write", "color": "green", "datapointName": "vmWriteIOPerSecond", "isVirtual": false}]}, {"name": "vDisk Latency", "title": "vDisk Latency", "verticalLabel": "microseconds", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "vmAverageLatency", "datapointName": "vmAverageLatency", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "I/O Latency", "color": "orange", "datapointName": "vmAverageLatency", "isVirtual": false}]}, {"name": "vDisk Throughput", "title": "vDisk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "vmIOBandwidth", "datapointName": "vmIOBandwidth", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Throughput", "color": "silver", "datapointName": "vmIOBandwidth", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 VMs by CPU Utilization", "title": "Top 10 VMs by CPU Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "vmCpuUsagePercentage", "datapointName": "vmCpuUsagePercentage", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "vmCpuUsagePercentage", "isVirtual": false}]}, {"name": "Top 10 VMs by Latency", "title": "Top 10 VMs by Latency", "verticalLabel": "microseconds", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "vmAverageLatency", "datapointName": "vmAverageLatency", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "blue", "datapointName": "vmAverageLatency", "isVirtual": false}]}, {"name": "Top 10 VMs by Memory Utilization", "title": "Top 10 VMs by Memory Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 4, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "vmMemoryUsagePercentage", "datapointName": "vmMemoryUsagePercentage", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "vmMemoryUsagePercentage", "isVirtual": false}]}, {"name": "Top 10 VMs by Storage Throughput", "title": "Top 10 VMs by Storage Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "vmIOBandwidth", "datapointName": "vmIOBandwidth", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "vmIOBandwidth", "isVirtual": false}]}, {"name": "Top 10 VMs by Total IOPS", "title": "Top 10 VMs by Total IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "vmReadIOPerSecond", "datapointName": "vmReadIOPerSecond", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "vmWriteIOPerSecond", "datapointName": "vmWriteIOPerSecond", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "totalIOPS", "expr": "vmReadIOPerSecond + vmWriteIOPerSecond"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "blue", "datapointName": "totalIOPS", "isVirtual": true}]}]}

×DataSource: Microsoft_Azure_ScaleSetVirtualMachine (1433)

{"name": "Microsoft_Azure_ScaleSetVirtualMachine", "description": "Monitors the individual virtual machine metrics associated with an Azure VM Scale Set.", "appliesTo": "hasCategory(\"Azure/VirtualMachineScaleSetVM\")", "searchKeywords": "cloud,disk,scale set,vm,cpu,azure", "technicalNotes": "- Do not change the polling interval from 1m. This is Azure's monitoring interval.", "displayedAs": "Azure Scale Set Virtual Machine", "collectionInterval": "1m", "collectionMethod": "azureinsights", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "CPUCreditsConsumed", "description": "Total number of credits consumed by the Virtual Machine", "interpretMethod": "json", "interpretExpr": "CPU Credits Consumed.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CPUCreditsRemaining", "description": "Total number of credits available to burst", "interpretMethod": "json", "interpretExpr": "CPU Credits Remaining.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataDiskQueueDepth", "description": "Data Disk Queue Depth(or Queue Length)", "interpretMethod": "json", "interpretExpr": "Data Disk Queue Depth.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataDiskReadBytesPersec", "description": "Bytes/Sec read from a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Data Disk Read Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataDiskReadOperationsPerSec", "description": "Read IOPS from a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Data Disk Read Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataDiskWriteBytesPersec", "description": "Bytes/Sec written to a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Data Disk Write Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataDiskWriteOperationsPerSec", "description": "Write IOPS from a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Data Disk Write Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskReadBytes", "description": "Bytes read from disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Disk Read Bytes.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskReadOperationsPerSec", "description": "Average number of disk read operations.", "interpretMethod": "json", "interpretExpr": "Disk Read Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "max": "100000.0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskWriteBytes", "description": "Bytes written to disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Disk Write Bytes.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskWriteOperationsPerSec", "description": "Average number of disk write operations.", "interpretMethod": "json", "interpretExpr": "Disk Write Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "max": "100000.0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "InboundFlows", "description": "Inbound Flows are number of current flows in the inbound direction (traffic going into the VM)", "interpretMethod": "json", "interpretExpr": "Inbound Flows.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "InboundFlowsMaximumCreationRate", "description": "The maximum creation rate of inbound flows (traffic going into the VM)", "interpretMethod": "json", "interpretExpr": "Inbound Flows Maximum Creation Rate.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NetworkIn", "description": "The number of billable bytes received on all network interfaces by the Virtual Machine(s) (Incoming Traffic)", "interpretMethod": "json", "interpretExpr": "Network In.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NetworkInTotal", "description": "The number of bytes received on all network interfaces by the Virtual Machine(s) (Incoming Traffic)", "interpretMethod": "json", "interpretExpr": "Network In Total.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NetworkOut", "description": "The number of billable bytes out on all network interfaces by the Virtual Machine(s) (Outgoing Traffic)", "interpretMethod": "json", "interpretExpr": "Network Out.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NetworkOutTotal", "description": "The number of bytes out on all network interfaces by the Virtual Machine(s) (Outgoing Traffic)", "interpretMethod": "json", "interpretExpr": "Network Out Total.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSDiskQueueDepth", "description": "OS Disk Queue Depth(or Queue Length)", "interpretMethod": "json", "interpretExpr": "OS Disk Queue Depth.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSDiskReadBytesPersec", "description": "Bytes/Sec read from a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Disk Read Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSDiskReadOperationsPerSec", "description": "Read IOPS from a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Disk Read Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSDiskWriteBytesPersec", "description": "Bytes/Sec written to a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Disk Write Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSDiskWriteOperationsPerSec", "description": "Write IOPS from a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Disk Write Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSPerDiskQD", "description": "OS Disk Queue Depth(or Queue Length)", "interpretMethod": "json", "interpretExpr": "OS Per Disk QD.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSPerDiskReadBytesPersec", "description": "Bytes/Sec read from a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Per Disk Read Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSPerDiskReadOperationsPerSec", "description": "Read IOPS from a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Per Disk Read Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSPerDiskWriteBytesPersec", "description": "Bytes/Sec written to a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Per Disk Write Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSPerDiskWriteOperationsPerSec", "description": "Write IOPS from a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Per Disk Write Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OutboundFlows", "description": "Outbound Flows are number of current flows in the outbound direction (traffic going out of the VM)", "interpretMethod": "json", "interpretExpr": "Outbound Flows.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OutboundFlowsMaximumCreationRate", "description": "The maximum creation rate of outbound flows (traffic going out of the VM)", "interpretMethod": "json", "interpretExpr": "Outbound Flows Maximum Creation Rate.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PerDiskQD", "description": "Data Disk Queue Depth(or Queue Length)", "interpretMethod": "json", "interpretExpr": "Per Disk QD.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PerDiskReadBytesPersec", "description": "Bytes/Sec read from a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Per Disk Read Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PerDiskReadOperationsPerSec", "description": "Read IOPS from a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Per Disk Read Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PerDiskWriteBytesPersec", "description": "Bytes/Sec written to a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Per Disk Write Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PerDiskWriteOperationsPerSec", "description": "Write IOPS from a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Per Disk Write Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PercentageCPU", "description": "The percentage of allocated compute units that are currently in use by the VM's in the set.", "interpretMethod": "json", "interpretExpr": "Percentage CPU.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "max": "100.0", "threshold": ">= 85 95", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Azure Virtual Machine Scale Set ##HOST## is experiencing high CPU usage of ##VALUE## %, placing the Scale Set into ##LEVEL## state.\n\nIf you are experiencing high CPU usage over an extended period of time, your scale set may not be properly configured to autoscale appropriately. \n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "PremiumDataDiskCacheReadHit", "description": "Premium Data Disk Cache Read Hit", "interpretMethod": "json", "interpretExpr": "Premium Data Disk Cache Read Hit.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PremiumDataDiskCacheReadHitRatio", "description": "The percentage of successful read operations from the Premium Data Disk Cache.", "interpretMethod": "expression", "interpretExpr": "(PremiumDataDiskCacheReadHit/(PremiumDataDiskCacheReadHit + PremiumDataDiskCacheReadMiss))*100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PremiumDataDiskCacheReadMiss", "description": "Premium Data Disk Cache Read Miss", "interpretMethod": "json", "interpretExpr": "Premium Data Disk Cache Read Miss.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PremiumOSDiskCacheReadHit", "description": "Premium OS Disk Cache Read Hit", "interpretMethod": "json", "interpretExpr": "Premium OS Disk Cache Read Hit.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PremiumOSDiskCacheReadHitRatio", "description": "The percentage of successful read operations from the Premium OS Disk Cache.", "interpretMethod": "expression", "interpretExpr": "(PremiumOSDiskCacheReadHit/(PremiumOSDiskCacheReadHit + PremiumOSDiskCacheReadMiss))*100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PremiumOSDiskCacheReadMiss", "description": "Premium OS Disk Cache Read Miss", "interpretMethod": "json", "interpretExpr": "Premium OS Disk Cache Read Miss.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Average Disk IOPS", "title": "Average Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskReadOperationsPerSec", "datapointName": "PerDiskReadOperationsPerSec", "consolidationFn": "average"}, {"name": "DiskWriteOperationsPerSec", "datapointName": "PerDiskWriteOperationsPerSec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadOperationsPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteOperationsPerSec", "isVirtual": false}]}, {"name": "Average Disk Throughput", "title": "Average Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "DiskReadBytesPerSec", "datapointName": "PerDiskReadBytesPersec", "consolidationFn": "average"}, {"name": "DiskWriteBytesPerSec", "datapointName": "PerDiskWriteBytesPersec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadBytesPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteBytesPerSec", "isVirtual": false}]}, {"name": "CPU Burst Credits", "title": "CPU Burst Credits", "verticalLabel": "credits", "min": 0.0, "displayPriority": 100, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CPUCreditsConsumed", "datapointName": "CPUCreditsConsumed", "consolidationFn": "average"}, {"name": "CPUCreditsRemaining", "datapointName": "CPUCreditsRemaining", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "CPU Credits Used", "color": "orange2", "datapointName": "CPUCreditsConsumed", "isVirtual": false}, {"type": "stack", "legend": "CPU Credits Remaining", "color": "olive", "datapointName": "CPUCreditsRemaining", "isVirtual": false}]}, {"name": "CPU Usage", "title": "CPU Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PercentageCPU", "datapointName": "PercentageCPU", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "CPU", "color": "orange2", "datapointName": "PercentageCPU", "isVirtual": false}]}, {"name": "Connections", "title": "Connections", "verticalLabel": "connections", "min": 0.0, "displayPriority": 15, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "InboundFlows", "datapointName": "InboundFlows", "consolidationFn": "average"}, {"name": "InboundFlowsMaximumCreationRate", "datapointName": "InboundFlowsMaximumCreationRate", "consolidationFn": "average"}, {"name": "OutboundFlows", "datapointName": "OutboundFlows", "consolidationFn": "average"}, {"name": "OutboundFlowsMaximumCreationRate", "datapointName": "OutboundFlowsMaximumCreationRate", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Current Inbound Connections", "color": "teal", "datapointName": "InboundFlows", "isVirtual": false}, {"type": "line", "legend": "Maximum Inbound Connection Creation Rate", "color": "navy", "datapointName": "InboundFlowsMaximumCreationRate", "isVirtual": false}, {"type": "area", "legend": "Current Outbound Connections", "color": "lime", "datapointName": "OutboundFlows", "isVirtual": false}, {"type": "line", "legend": "Maximum Outbound Connections Creation Rate", "color": "green", "datapointName": "OutboundFlowsMaximumCreationRate", "isVirtual": false}]}, {"name": "Data Disk IOPS", "title": "Data Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskReadOperationsPerSec", "datapointName": "DataDiskReadOperationsPerSec", "consolidationFn": "average"}, {"name": "DiskWriteOperationsPerSec", "datapointName": "DataDiskWriteOperationsPerSec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadOperationsPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteOperationsPerSec", "isVirtual": false}]}, {"name": "Data Disk Throughput", "title": "Data Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "DiskReadBytesPerSec", "datapointName": "DataDiskReadBytesPersec", "consolidationFn": "average"}, {"name": "DiskWriteBytesPerSec", "datapointName": "DataDiskWriteBytesPersec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadBytesPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteBytesPerSec", "isVirtual": false}]}, {"name": "Disk IOPS", "title": "Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskReadOperationsPerSec", "datapointName": "DiskReadOperationsPerSec", "consolidationFn": "average"}, {"name": "DiskWriteOperationsPerSec", "datapointName": "DiskWriteOperationsPerSec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "blue", "datapointName": "DiskReadOperationsPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "olive", "datapointName": "DiskWriteOperationsPerSec", "isVirtual": false}]}, {"name": "Network Throughput", "title": "Network Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "NetworkIn", "datapointName": "NetworkIn", "consolidationFn": "average"}, {"name": "NetworkInTotal", "datapointName": "NetworkInTotal", "consolidationFn": "average"}, {"name": "NetworkOut", "datapointName": "NetworkOut", "consolidationFn": "average"}, {"name": "NetworkOutTotal", "datapointName": "NetworkOutTotal", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "NetworkInBits", "expr": "NetworkIn*8"}, {"name": "NetworkInTotalBits", "expr": "NetworkInTotal*8"}, {"name": "NetworkOutBits", "expr": "NetworkOut*8"}, {"name": "NetworkOutTotalBits", "expr": "NetworkOutTotal*8"}], "lines": [{"type": "line", "legend": "In (Billable)", "color": "navy", "datapointName": "NetworkInBits", "isVirtual": true}, {"type": "line", "legend": "In (Total)", "color": "aqua", "datapointName": "NetworkInTotalBits", "isVirtual": true}, {"type": "line", "legend": "Out (Billable)", "color": "green", "datapointName": "NetworkOutBits", "isVirtual": true}, {"type": "line", "legend": "Out (Total)", "color": "lime", "datapointName": "NetworkOutTotalBits", "isVirtual": true}]}, {"name": "OS Disk IOPS", "title": "OS Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskReadOperationsPerSec", "datapointName": "OSDiskReadOperationsPerSec", "consolidationFn": "average"}, {"name": "DiskWriteOperationsPerSec", "datapointName": "OSDiskWriteOperationsPerSec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadOperationsPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteOperationsPerSec", "isVirtual": false}]}, {"name": "OS Disk Throughput", "title": "OS Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "DiskReadBytesPerSec", "datapointName": "OSDiskReadBytesPersec", "consolidationFn": "average"}, {"name": "DiskWriteBytesPerSec", "datapointName": "OSDiskWriteBytesPersec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadBytesPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteBytesPerSec", "isVirtual": false}]}, {"name": "Premium Cache Read Hit Ratio", "title": "Premium Cache Read Hit Ratio", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 150, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PremiumDataDiskCacheReadHitRatio", "datapointName": "PremiumDataDiskCacheReadHitRatio", "consolidationFn": "average"}, {"name": "PremiumOSDiskCacheReadHitRatio", "datapointName": "PremiumOSDiskCacheReadHitRatio", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Data Disk Read Hit Ratio", "color": "silver", "datapointName": "PremiumDataDiskCacheReadHitRatio", "isVirtual": false}, {"type": "line", "legend": "OS Disk Read Hit Ratio", "color": "blue", "datapointName": "PremiumOSDiskCacheReadHitRatio", "isVirtual": false}]}, {"name": "Queue Length", "title": "Queue Length", "verticalLabel": "operations", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DataDiskQueueDepth", "datapointName": "DataDiskQueueDepth", "consolidationFn": "average"}, {"name": "OSDiskQueueDepth", "datapointName": "OSDiskQueueDepth", "consolidationFn": "average"}, {"name": "PerDiskQD", "datapointName": "PerDiskQD", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Data Disk Queue Depth", "color": "aqua", "datapointName": "DataDiskQueueDepth", "isVirtual": false}, {"type": "line", "legend": "OS Disk Queue Depth", "color": "silver", "datapointName": "OSDiskQueueDepth", "isVirtual": false}, {"type": "line", "legend": "Average Queue Depth", "color": "green", "datapointName": "PerDiskQD", "isVirtual": false}]}, {"name": "Total Disk IOPS", "title": "Total Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskReadOperationsPerSec", "datapointName": "DiskReadOperationsPerSec", "consolidationFn": "average"}, {"name": "DiskWriteOperationsPerSec", "datapointName": "DiskWriteOperationsPerSec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "navy", "datapointName": "DiskReadOperationsPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "olive", "datapointName": "DiskWriteOperationsPerSec", "isVirtual": false}]}, {"name": "Total Disk Throughput", "title": "Total Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "DiskReadBytesPerSec", "datapointName": "DiskReadBytes", "consolidationFn": "average"}, {"name": "DiskWriteBytesPerSec", "datapointName": "DiskWriteBytes", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadBytesPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteBytesPerSec", "isVirtual": false}]}]}

×DataSource: Microsoft_Azure_VirtualMachineScaleSet (1432)

{"name": "Microsoft_Azure_VirtualMachineScaleSet", "description": "Monitors the aggregate virtual machine metrics associated with an Azure VM Scale Set.", "appliesTo": "hasCategory(\"Azure/VirtualMachineScaleSet\")", "searchKeywords": "cloud,disk,scale set,vm,cpu,azure", "technicalNotes": "- Do not change the polling interval from 1m. This is Azure's monitoring interval.", "displayedAs": "Azure Virtual Machine Scale Set", "collectionInterval": "1m", "collectionMethod": "azureinsights", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "CPUCreditsConsumed", "description": "Total number of credits consumed by the Virtual Machine", "interpretMethod": "json", "interpretExpr": "CPU Credits Consumed.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CPUCreditsRemaining", "description": "Total number of credits available to burst", "interpretMethod": "json", "interpretExpr": "CPU Credits Remaining.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataDiskQueueDepth", "description": "Data Disk Queue Depth(or Queue Length)", "interpretMethod": "json", "interpretExpr": "Data Disk Queue Depth.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataDiskReadBytesPersec", "description": "Bytes/Sec read from a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Data Disk Read Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataDiskReadOperationsPerSec", "description": "Read IOPS from a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Data Disk Read Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataDiskWriteBytesPersec", "description": "Bytes/Sec written to a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Data Disk Write Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataDiskWriteOperationsPerSec", "description": "Write IOPS from a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Data Disk Write Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskReadBytes", "description": "Bytes read from disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Disk Read Bytes.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskReadOperationsPerSec", "description": "Average number of disk read operations.", "interpretMethod": "json", "interpretExpr": "Disk Read Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "max": "100000.0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskWriteBytes", "description": "Bytes written to disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Disk Write Bytes.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskWriteOperationsPerSec", "description": "Average number of disk write operations.", "interpretMethod": "json", "interpretExpr": "Disk Write Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "max": "100000.0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "InboundFlows", "description": "Inbound Flows are number of current flows in the inbound direction (traffic going into the VM)", "interpretMethod": "json", "interpretExpr": "Inbound Flows.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "InboundFlowsMaximumCreationRate", "description": "The maximum creation rate of inbound flows (traffic going into the VM)", "interpretMethod": "json", "interpretExpr": "Inbound Flows Maximum Creation Rate.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NetworkIn", "description": "The number of billable bytes received on all network interfaces by the Virtual Machine(s) (Incoming Traffic)", "interpretMethod": "json", "interpretExpr": "Network In.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NetworkInTotal", "description": "The number of bytes received on all network interfaces by the Virtual Machine(s) (Incoming Traffic)", "interpretMethod": "json", "interpretExpr": "Network In Total.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NetworkOut", "description": "The number of billable bytes out on all network interfaces by the Virtual Machine(s) (Outgoing Traffic)", "interpretMethod": "json", "interpretExpr": "Network Out.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NetworkOutTotal", "description": "The number of bytes out on all network interfaces by the Virtual Machine(s) (Outgoing Traffic)", "interpretMethod": "json", "interpretExpr": "Network Out Total.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSDiskQueueDepth", "description": "OS Disk Queue Depth(or Queue Length)", "interpretMethod": "json", "interpretExpr": "OS Disk Queue Depth.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSDiskReadBytesPersec", "description": "Bytes/Sec read from a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Disk Read Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSDiskReadOperationsPerSec", "description": "Read IOPS from a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Disk Read Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSDiskWriteBytesPersec", "description": "Bytes/Sec written to a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Disk Write Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSDiskWriteOperationsPerSec", "description": "Write IOPS from a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Disk Write Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSPerDiskQD", "description": "OS Disk Queue Depth(or Queue Length)", "interpretMethod": "json", "interpretExpr": "OS Per Disk QD.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSPerDiskReadBytesPersec", "description": "Bytes/Sec read from a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Per Disk Read Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSPerDiskReadOperationsPerSec", "description": "Read IOPS from a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Per Disk Read Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSPerDiskWriteBytesPersec", "description": "Bytes/Sec written to a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Per Disk Write Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSPerDiskWriteOperationsPerSec", "description": "Write IOPS from a single disk during monitoring period for OS disk", "interpretMethod": "json", "interpretExpr": "OS Per Disk Write Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OutboundFlows", "description": "Outbound Flows are number of current flows in the outbound direction (traffic going out of the VM)", "interpretMethod": "json", "interpretExpr": "Outbound Flows.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OutboundFlowsMaximumCreationRate", "description": "The maximum creation rate of outbound flows (traffic going out of the VM)", "interpretMethod": "json", "interpretExpr": "Outbound Flows Maximum Creation Rate.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PerDiskQD", "description": "Data Disk Queue Depth(or Queue Length)", "interpretMethod": "json", "interpretExpr": "Per Disk QD.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PerDiskReadBytesPersec", "description": "Bytes/Sec read from a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Per Disk Read Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PerDiskReadOperationsPerSec", "description": "Read IOPS from a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Per Disk Read Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PerDiskWriteBytesPersec", "description": "Bytes/Sec written to a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Per Disk Write Bytes/sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PerDiskWriteOperationsPerSec", "description": "Write IOPS from a single disk during monitoring period", "interpretMethod": "json", "interpretExpr": "Per Disk Write Operations/Sec.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PercentageCPU", "description": "The percentage of allocated compute units that are currently in use by the VM's in the set.", "interpretMethod": "json", "interpretExpr": "Percentage CPU.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "max": "100.0", "threshold": ">= 85 95", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Azure Virtual Machine Scale Set ##HOST## is experiencing high CPU usage of ##VALUE## %, placing the Scale Set into ##LEVEL## state.\n\nIf you are experiencing high CPU usage over an extended period of time, your scale set may not be properly configured to autoscale appropriately. \n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "PremiumDataDiskCacheReadHit", "description": "Premium Data Disk Cache Read Hit", "interpretMethod": "json", "interpretExpr": "Premium Data Disk Cache Read Hit.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PremiumDataDiskCacheReadHitRatio", "description": "The percentage of successful read operations from the Premium Data Disk Cache.", "interpretMethod": "expression", "interpretExpr": "(PremiumDataDiskCacheReadHit/(PremiumDataDiskCacheReadHit + PremiumDataDiskCacheReadMiss))*100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PremiumDataDiskCacheReadMiss", "description": "Premium Data Disk Cache Read Miss", "interpretMethod": "json", "interpretExpr": "Premium Data Disk Cache Read Miss.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PremiumOSDiskCacheReadHit", "description": "Premium OS Disk Cache Read Hit", "interpretMethod": "json", "interpretExpr": "Premium OS Disk Cache Read Hit.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PremiumOSDiskCacheReadHitRatio", "description": "The percentage of successful read operations from the Premium OS Disk Cache.", "interpretMethod": "expression", "interpretExpr": "(PremiumOSDiskCacheReadHit/(PremiumOSDiskCacheReadHit + PremiumOSDiskCacheReadMiss))*100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PremiumOSDiskCacheReadMiss", "description": "Premium OS Disk Cache Read Miss", "interpretMethod": "json", "interpretExpr": "Premium OS Disk Cache Read Miss.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Average Disk IOPS", "title": "Average Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskReadOperationsPerSec", "datapointName": "PerDiskReadOperationsPerSec", "consolidationFn": "average"}, {"name": "DiskWriteOperationsPerSec", "datapointName": "PerDiskWriteOperationsPerSec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadOperationsPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteOperationsPerSec", "isVirtual": false}]}, {"name": "Average Disk Throughput", "title": "Average Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "DiskReadBytesPerSec", "datapointName": "PerDiskReadBytesPersec", "consolidationFn": "average"}, {"name": "DiskWriteBytesPerSec", "datapointName": "PerDiskWriteBytesPersec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadBytesPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteBytesPerSec", "isVirtual": false}]}, {"name": "CPU Burst Credits", "title": "CPU Burst Credits", "verticalLabel": "credits", "min": 0.0, "displayPriority": 100, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CPUCreditsConsumed", "datapointName": "CPUCreditsConsumed", "consolidationFn": "average"}, {"name": "CPUCreditsRemaining", "datapointName": "CPUCreditsRemaining", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "CPU Credits Used", "color": "orange2", "datapointName": "CPUCreditsConsumed", "isVirtual": false}, {"type": "stack", "legend": "CPU Credits Remaining", "color": "olive", "datapointName": "CPUCreditsRemaining", "isVirtual": false}]}, {"name": "CPU Usage", "title": "CPU Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PercentageCPU", "datapointName": "PercentageCPU", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "CPU", "color": "orange2", "datapointName": "PercentageCPU", "isVirtual": false}]}, {"name": "Connections", "title": "Connections", "verticalLabel": "connections", "min": 0.0, "displayPriority": 15, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "InboundFlows", "datapointName": "InboundFlows", "consolidationFn": "average"}, {"name": "InboundFlowsMaximumCreationRate", "datapointName": "InboundFlowsMaximumCreationRate", "consolidationFn": "average"}, {"name": "OutboundFlows", "datapointName": "OutboundFlows", "consolidationFn": "average"}, {"name": "OutboundFlowsMaximumCreationRate", "datapointName": "OutboundFlowsMaximumCreationRate", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Current Inbound Connections", "color": "teal", "datapointName": "InboundFlows", "isVirtual": false}, {"type": "line", "legend": "Maximum Inbound Connection Creation Rate", "color": "navy", "datapointName": "InboundFlowsMaximumCreationRate", "isVirtual": false}, {"type": "area", "legend": "Current Outbound Connections", "color": "lime", "datapointName": "OutboundFlows", "isVirtual": false}, {"type": "line", "legend": "Maximum Outbound Connections Creation Rate", "color": "green", "datapointName": "OutboundFlowsMaximumCreationRate", "isVirtual": false}]}, {"name": "Data Disk IOPS", "title": "Data Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskReadOperationsPerSec", "datapointName": "DataDiskReadOperationsPerSec", "consolidationFn": "average"}, {"name": "DiskWriteOperationsPerSec", "datapointName": "DataDiskWriteOperationsPerSec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadOperationsPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteOperationsPerSec", "isVirtual": false}]}, {"name": "Data Disk Throughput", "title": "Data Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "DiskReadBytesPerSec", "datapointName": "DataDiskReadBytesPersec", "consolidationFn": "average"}, {"name": "DiskWriteBytesPerSec", "datapointName": "DataDiskWriteBytesPersec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadBytesPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteBytesPerSec", "isVirtual": false}]}, {"name": "Disk IOPS", "title": "Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskReadOperationsPerSec", "datapointName": "DiskReadOperationsPerSec", "consolidationFn": "average"}, {"name": "DiskWriteOperationsPerSec", "datapointName": "DiskWriteOperationsPerSec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "navy", "datapointName": "DiskReadOperationsPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "olive", "datapointName": "DiskWriteOperationsPerSec", "isVirtual": false}]}, {"name": "Network Throughput", "title": "Network Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "NetworkIn", "datapointName": "NetworkIn", "consolidationFn": "average"}, {"name": "NetworkInTotal", "datapointName": "NetworkInTotal", "consolidationFn": "average"}, {"name": "NetworkOut", "datapointName": "NetworkOut", "consolidationFn": "average"}, {"name": "NetworkOutTotal", "datapointName": "NetworkOutTotal", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "NetworkInBits", "expr": "NetworkIn*8"}, {"name": "NetworkInTotalBits", "expr": "NetworkInTotal*8"}, {"name": "NetworkOutBits", "expr": "NetworkOut*8"}, {"name": "NetworkOutTotalBits", "expr": "NetworkOutTotal*8"}], "lines": [{"type": "line", "legend": "In (Billable)", "color": "navy", "datapointName": "NetworkInBits", "isVirtual": true}, {"type": "line", "legend": "In (Total)", "color": "aqua", "datapointName": "NetworkInTotalBits", "isVirtual": true}, {"type": "line", "legend": "Out (Billable)", "color": "green", "datapointName": "NetworkOutBits", "isVirtual": true}, {"type": "line", "legend": "Out (Total)", "color": "lime", "datapointName": "NetworkOutTotalBits", "isVirtual": true}]}, {"name": "OS Disk IOPS", "title": "OS Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskReadOperationsPerSec", "datapointName": "OSDiskReadOperationsPerSec", "consolidationFn": "average"}, {"name": "DiskWriteOperationsPerSec", "datapointName": "OSDiskWriteOperationsPerSec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadOperationsPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteOperationsPerSec", "isVirtual": false}]}, {"name": "OS Disk Throughput", "title": "OS Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "DiskReadBytesPerSec", "datapointName": "OSDiskReadBytesPersec", "consolidationFn": "average"}, {"name": "DiskWriteBytesPerSec", "datapointName": "OSDiskWriteBytesPersec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadBytesPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteBytesPerSec", "isVirtual": false}]}, {"name": "Premium Cache Read Hit Ratio", "title": "Premium Cache Read Hit Ratio", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 150, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PremiumDataDiskCacheReadHitRatio", "datapointName": "PremiumDataDiskCacheReadHitRatio", "consolidationFn": "average"}, {"name": "PremiumOSDiskCacheReadHitRatio", "datapointName": "PremiumOSDiskCacheReadHitRatio", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Data Disk Read Hit Ratio", "color": "silver", "datapointName": "PremiumDataDiskCacheReadHitRatio", "isVirtual": false}, {"type": "line", "legend": "OS Disk Read Hit Ratio", "color": "blue", "datapointName": "PremiumOSDiskCacheReadHitRatio", "isVirtual": false}]}, {"name": "Queue Length", "title": "Queue Length", "verticalLabel": "operations", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DataDiskQueueDepth", "datapointName": "DataDiskQueueDepth", "consolidationFn": "average"}, {"name": "OSDiskQueueDepth", "datapointName": "OSDiskQueueDepth", "consolidationFn": "average"}, {"name": "PerDiskQD", "datapointName": "PerDiskQD", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Data Disk Queue Depth", "color": "aqua", "datapointName": "DataDiskQueueDepth", "isVirtual": false}, {"type": "line", "legend": "OS Disk Queue Depth", "color": "silver", "datapointName": "OSDiskQueueDepth", "isVirtual": false}, {"type": "line", "legend": "Average Queue Depth", "color": "green", "datapointName": "PerDiskQD", "isVirtual": false}]}, {"name": "Total Disk IOPS", "title": "Total Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskReadOperationsPerSec", "datapointName": "DiskReadOperationsPerSec", "consolidationFn": "average"}, {"name": "DiskWriteOperationsPerSec", "datapointName": "DiskWriteOperationsPerSec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "navy", "datapointName": "DiskReadOperationsPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "olive", "datapointName": "DiskWriteOperationsPerSec", "isVirtual": false}]}, {"name": "Total Disk Throughput", "title": "Total Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "DiskReadBytesPerSec", "datapointName": "DiskReadBytes", "consolidationFn": "average"}, {"name": "DiskWriteBytesPerSec", "datapointName": "DiskWriteBytes", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "DiskReadBytesPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "green", "datapointName": "DiskWriteBytesPerSec", "isVirtual": false}]}]}

×DataSource: HP_MSA_VoltageSensors (2301)

{"name": "HP_MSA_VoltageSensors", "description": "Monitors the HP MSA voltage sensor readings and operating status.", "appliesTo": "hasCategory(\"HPMSA\")", "searchKeywords": "hp,msa,storage,voltage", "displayedAs": "MSA Voltage Sensors", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_snmp", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"discoveryType": "value", "oid": ".1.3.6.1.3.94.1.8.1.3"}, "filters": [{"attr": ".1.3.6.1.3.94.1.8.1.3", "op": "Contain", "value": "Volt"}], "groupMethod": "none"}, "datapoints": [{"name": "SensorStatus", "description": "The status indicated by the sensor.\n\n\nStatus Codes:\n1=Unknown\n2=Other\n3=OK\n4=Warning\n5=Failed", "config": {"oid": ".1.3.6.1.3.94.1.8.1.4.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "threshold": "!= 3", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "HP MSA Voltage Sensor ##INSTANCE## on ##HOST## is reporting a temperature of ##VALUE## degrees Celsius, placing the device into ##LEVEL## state. \n\n\nStatus Codes:\n1=Unknown\n2=Other\n3=OK\n4=Warning\n5=Failed\n\nThis started at ##START## or ##DURATION## ago."}, {"name": "Voltage", "description": "Current voltage reading.", "config": {"oid": ".1.3.6.1.3.94.1.8.1.6.##WILDVALUE##"}, "interpretMethod": "regex", "interpretExpr": ":.(\\d+\\.\\d+)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}], "graphs": [{"name": "Sensor Status", "title": "Sensor Status", "verticalLabel": "status code", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "SensorStatus", "datapointName": "SensorStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "blue", "datapointName": "SensorStatus", "isVirtual": false}]}, {"name": "Voltage", "title": "Voltage", "verticalLabel": "volts", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "Voltage", "datapointName": "Voltage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Voltage", "color": "orange", "datapointName": "Voltage", "isVirtual": false}]}], "overviewGraphs": [{"name": "Highest Voltage Sensors", "title": "Highest Voltage Sensors", "verticalLabel": "volts", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Voltage", "datapointName": "Voltage", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "Voltage", "isVirtual": false}]}]}

×DataSource: Isilon Node Disks- (1638)

{"name": "Isilon Node Disks-", "description": "Monitors the Isilon disk IOPS, throughput and operating status.", "appliesTo": "hasCategory(\"Isilon\")", "searchKeywords": "disk,emc,storage,isilon", "displayedAs": "Node Disks-", "collectionInterval": "4m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_snmp", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"discoveryType": "value", "oid": ".1.3.6.1.4.1.12124.2.2.52.1.2", "ilp": [{"oid": ".1.3.6.1.4.1.12124.2.52.1.6.##WILDVALUE##", "name": "auto.disk_model", "method": "get"}, {"oid": ".1.3.6.1.4.1.12124.2.52.1.7.##WILDVALUE##", "name": "auto.disk_serial_number", "method": "get"}, {"oid": ".1.3.6.1.4.1.12124.2.52.1.8.##WILDVALUE##", "name": "auto.disk_firmware_version", "method": "get"}]}, "groupMethod": "none"}, "datapoints": [{"name": "DiskInbitsPerSecond", "description": "Number of inbound bits, per second, to the disk.", "config": {"oid": ".1.3.6.1.4.1.12124.2.2.52.1.4.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "DiskOpsPerSecond", "description": "Number of disk operations per second.", "config": {"oid": ".1.3.6.1.4.1.12124.2.2.52.1.3.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "DiskOutBitsPerSecond", "description": "Number of outbound bits, per second, from the disk.", "config": {"oid": ".1.3.6.1.4.1.12124.2.2.52.1.5.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "diskStatus", "description": "Current operating status of the disk.\n\nStatus Codes:\n0=Not Healthy,\n1=Healthy/L3 Cache/Journal", "config": {"oid": ".1.3.6.1.4.1.12124.2.52.1.5.##WILDVALUE##"}, "interpretMethod": "textmatch", "interpretExpr": "(HEALTHY|L3|JOURNAL)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "= 0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "Disk ##INSTANCE## - ##DSIDESCRIPTION## on EMC Isilon ##HOST## is no longer in a healthy operating state, placing the disk into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Disk IOPS", "title": "Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "DiskOpsPerSecond", "datapointName": "DiskOpsPerSecond", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Operations", "color": "blue", "datapointName": "DiskOpsPerSecond", "isVirtual": false}]}, {"name": "Disk Throughput", "title": "Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": true, "datapoints": [{"name": "DiskInbitsPerSecond", "datapointName": "DiskInbitsPerSecond", "consolidationFn": "average"}, {"name": "DiskOutBitsPerSecond", "datapointName": "DiskOutBitsPerSecond", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "InBytes", "expr": "DiskInbitsPerSecond/8"}, {"name": "OutBytes", "expr": "DiskOutBitsPerSecond/8"}], "lines": [{"type": "stack", "legend": "Receive", "color": "teal", "datapointName": "InBytes", "isVirtual": true}, {"type": "stack", "legend": "Send", "color": "olive", "datapointName": "OutBytes", "isVirtual": true}]}, {"name": "Operating Status", "title": "Operating Status", "verticalLabel": "status code", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "diskStatus", "datapointName": "diskStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "blue", "datapointName": "diskStatus", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Disks by IOPS", "title": "Top 10 Disks by IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskOpsPerSecond", "datapointName": "DiskOpsPerSecond", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "DiskOpsPerSecond", "isVirtual": false}]}, {"name": "Top 10 Disks by Throughput", "title": "Top 10 Disks by Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "DiskInbitsPerSecond", "datapointName": "DiskInbitsPerSecond", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "DiskOutBitsPerSecond", "datapointName": "DiskOutBitsPerSecond", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "TotalThroughput_Bytes", "expr": "(DiskInbitsPerSecond + DiskOutBitsPerSecond) / 8"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "TotalThroughput_Bytes", "isVirtual": true}]}]}

×DataSource: Azure_Storage_ServiceLimits (1901)

{"name": "Azure_Storage_ServiceLimits", "description": "Monitors Storage Limits and utilization. Instances are listed by subscription ID.", "appliesTo": "hasCategory(\"Azure/LMAccount\")", "searchKeywords": "cloud,storage,microsoft,azure", "technicalNotes": "Uses built in cloud collector protocols to access Azure insights.", "displayedAs": "Storage Service Limits", "collectionInterval": "10m", "collectionMethod": "azurestorageservicelimits", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_azuresubscription", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "groupMethod": "none"}, "datapoints": [{"name": "PercentStorageAccountUsage", "description": "Calculates and monitors the utilization percentage of Storage Accounts", "interpretMethod": "expression", "interpretExpr": "(StorageAccountsUsage*100)/StorageAccountsLimit", "type": "gauge", "dataType": 7, "min": "0", "threshold": ">= 90", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "You are now using ##VALUE##% of your available Storage Accounts in Azure Subscription: ##INSTANCE## on account ##HOST##. We recommend trying to consolidate Storage Accounts to free up utilization. This has placed this subscription in alert level: ##LEVEL##. This began at ##START## or ##DURATION## ago."}, {"name": "StorageAccountsLimit", "description": "Maximum number of Storage Accounts per subscription", "interpretMethod": "none", "interpretExpr": "StorageAccountsLimit", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "StorageAccountsUsage", "description": "Current number of Storage Accounts in use per subscription", "interpretMethod": "none", "interpretExpr": "StorageAccountsUsage", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Limit Utilization", "title": "Limit Utilization", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "StorageAccountsLimit", "datapointName": "StorageAccountsLimit", "consolidationFn": "average"}, {"name": "StorageAccountsUsage", "datapointName": "StorageAccountsUsage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Storage Accounts Limit", "color": "red1", "datapointName": "StorageAccountsLimit", "isVirtual": false}, {"type": "stack", "legend": "Storage Accounts Usage", "color": "silver", "datapointName": "StorageAccountsUsage", "isVirtual": false}]}, {"name": "Percent Limit Utilization", "title": "Percent Limit Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PercentStorageAccountUsage", "datapointName": "PercentStorageAccountUsage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Percent Storage Accounts Limit Usage", "color": "silver", "datapointName": "PercentStorageAccountUsage", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Subscriptions by Storage Group Utilization", "title": "Top 10 Subscriptions by Storage Group Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "StorageAccounts", "datapointName": "PercentStorageAccountUsage", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "StorageAccounts", "isVirtual": false}]}]}

×DataSource: AWS_VPC_NATGateway (1031)

{"name": "AWS_VPC_NATGateway", "description": "Monitors the AWS Virtual Private Cloud (VPC) NAT (Network Address Translation) Gateway performance.", "appliesTo": "hasCategory(\"AWS/NATGateway\")", "searchKeywords": "cloud,nat,vpc,networking,aws,gateway", "technicalNotes": "\"_raw\" datapoints are directly from CloudWatch. Their CDP counterparts substitute in \"0\" because CloudWatch returns a blank in the case of a \"0\". We differentiate from actual blank responses by checking the API status code.", "displayedAs": "AWS NAT Gateway", "collectionInterval": "3m", "collectionMethod": "awscloudwatch", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "ActiveConnectionCount", "description": "The total number of concurrent active TCP connections through the NAT gateway.\n\nA value of zero indicates that there are no active connections through the NAT gateway.", "interpretMethod": "expression", "interpretExpr": "if(and(un(ActiveConnectionCount_raw), eq(Status,0)),0,ActiveConnectionCount_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ActiveConnectionCount_raw", "description": "The total number of concurrent active TCP connections through the NAT gateway.\n\nA value of zero indicates that there are no active connections through the NAT gateway.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>ActiveConnectionCount>Max", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesInFromDestination", "description": "The number of bytes received by the NAT gateway from the destination.\n\nIf the value for BytesOutToSource is less than the value for BytesInFromDestination, there may be data loss during NAT gateway processing, or traffic being actively blocked by the NAT gateway.", "interpretMethod": "expression", "interpretExpr": "if(and(un(BytesInFromDestination_raw), eq(Status,0)),0,BytesInFromDestination_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesInFromDestination_raw", "description": "The number of bytes received by the NAT gateway from the destination.\n\nIf the value for BytesOutToSource is less than the value for BytesInFromDestination, there may be data loss during NAT gateway processing, or traffic being actively blocked by the NAT gateway.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>BytesInFromDestination>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesInFromSource", "description": "The number of bytes received by the NAT gateway from clients in your VPC.\n\nIf the value for BytesOutToDestination is less than the value for BytesInFromSource, there may be data loss during NAT gateway processing.", "interpretMethod": "expression", "interpretExpr": "if(and(un(BytesInFromSource_raw), eq(Status,0)),0,BytesInFromSource_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesInFromSource_raw", "description": "The number of bytes received by the NAT gateway from clients in your VPC.\n\nIf the value for BytesOutToDestination is less than the value for BytesInFromSource, there may be data loss during NAT gateway processing.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>BytesInFromSource>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesOutToDestination", "description": "The number of bytes sent out through the NAT gateway to the destination.\n\nA value greater than zero indicates that there is traffic going to the internet from clients that are behind the NAT gateway. If the value for BytesOutToDestination is less than the value for BytesInFromSource, there may be data loss during NAT gateway processing.", "interpretMethod": "expression", "interpretExpr": "if(and(un(BytesOutToDestination_raw), eq(Status,0)),0,BytesOutToDestination_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesOutToDestination_raw", "description": "The number of bytes sent out through the NAT gateway to the destination.\n\nA value greater than zero indicates that there is traffic going to the internet from clients that are behind the NAT gateway. If the value for BytesOutToDestination is less than the value for BytesInFromSource, there may be data loss during NAT gateway processing.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>BytesOutToDestination>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesOutToSource", "description": "The number of bytes sent through the NAT gateway to the clients in your VPC.\n\nA value greater than zero indicates that there is traffic coming from the internet to clients that are behind the NAT gateway. If the value for BytesOutToSource is less than the value for BytesInFromDestination, there may be data loss during NAT gateway processing, or traffic being actively blocked by the NAT gateway.", "interpretMethod": "expression", "interpretExpr": "if(and(un(BytesOutToSource_raw), eq(Status,0)),0,BytesOutToSource_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesOutToSource_raw", "description": "The number of bytes sent through the NAT gateway to the clients in your VPC.\n\nA value greater than zero indicates that there is traffic coming from the internet to clients that are behind the NAT gateway. If the value for BytesOutToSource is less than the value for BytesInFromDestination, there may be data loss during NAT gateway processing, or traffic being actively blocked by the NAT gateway.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>BytesOutToSource>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ConnectionAttemptCount", "description": "The number of connection attempts made through the NAT gateway.\n\nIf the value for ConnectionEstablishedCount is less than the value for ConnectionAttemptCount, this indicates that clients behind the NAT gateway attempted to establish new connections for which there was no response.", "interpretMethod": "expression", "interpretExpr": "if(and(un(ConnectionAttemptCount_raw), eq(Status,0)),0,ConnectionAttemptCount_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ConnectionAttemptCount_raw", "description": "The number of connection attempts made through the NAT gateway.\n\nIf the value for ConnectionEstablishedCount is less than the value for ConnectionAttemptCount, this indicates that clients behind the NAT gateway attempted to establish new connections for which there was no response.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>ConnectionAttemptCount>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ConnectionEstablishedCount", "description": "The number of connections established through the NAT gateway.\n\nIf the value for ConnectionEstablishedCount is less than the value for ConnectionAttemptCount, this indicates that clients behind the NAT gateway attempted to establish new connections for which there was no response.", "interpretMethod": "expression", "interpretExpr": "if(and(un(ConnectionEstablishedCount_raw), eq(Status,0)),0,ConnectionEstablishedCount_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ConnectionEstablishedCount_raw", "description": "The number of connections established through the NAT gateway.\n\nIf the value for ConnectionEstablishedCount is less than the value for ConnectionAttemptCount, this indicates that clients behind the NAT gateway attempted to establish new connections for which there was no response.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>ConnectionEstablishedCount>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ErrorPortAllocation", "description": "Number of times per second the NAT gateway could not allocate a source port.\n\nA value greater than zero indicates that too many concurrent connections are open through the NAT gateway.", "interpretMethod": "expression", "interpretExpr": "if(and(un(ErrorPortAllocation_raw), eq(Status,0)),0,ErrorPortAllocation_raw)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "AWS VPC NAT Gateway ##HOST## is reporting ##VALUE## port allocation errors/sec, placing the host into ##LEVEL## state.\n\nThere are too many concurrent connections open through the NAT gateway.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "ErrorPortAllocation_raw", "description": "The number of times the NAT gateway could not allocate a source port.\n\nA value greater than zero indicates that too many concurrent connections are open through the NAT gateway.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>ErrorPortAllocation>Sum", "useValue": "rawData", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IdleTimeoutCount", "description": "The number of connections that transitioned from the active state to the idle state. An active connection transitions to idle if it was not closed gracefully and there was no activity for the last 350 seconds.\n\nA value greater than zero indicates that there are connections that have been moved to an idle state. If the value for IdleTimeoutCount increases, it may indicate that clients behind the NAT gateway are re-using stale connections.", "interpretMethod": "expression", "interpretExpr": "if(and(un(IdleTimeoutCount_raw), eq(Status,0)),0,IdleTimeoutCount_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IdleTimeoutCount_raw", "description": "The number of connections that transitioned from the active state to the idle state. An active connection transitions to idle if it was not closed gracefully and there was no activity for the last 350 seconds.\n\nA value greater than zero indicates that there are connections that have been moved to an idle state. If the value for IdleTimeoutCount increases, it may indicate that clients behind the NAT gateway are re-using stale connections.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>IdleTimeoutCount>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsDropCount", "description": "Number of packets dropped per second by the NAT gateway.\n\nA value greater than zero may indicate an ongoing transient issue with the NAT gateway. If this value is high, see the AWS service health dashboard.", "interpretMethod": "expression", "interpretExpr": "if(and(un(PacketsDropCount_raw), eq(Status,0)),0,PacketsDropCount_raw)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "AWS VPC NAT Gateway ##HOST## is dropping ##VALUE## packets/sec, placing the host into ##LEVEL## state.\n\nThis may be indicative of an ongoing transient issue with the NAT gateway. If you are continuously seeing high packet loss please see the AWS service health dashboard.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "PacketsDropCount_raw", "description": "The number of packets/sec dropped by the NAT gateway.\n\nA value greater than zero may indicate an ongoing transient issue with the NAT gateway. If this value is high, see the AWS service health dashboard.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>PacketsDropCount>Sum", "useValue": "rawData", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsInFromDestination", "description": "The number of packets received by the NAT gateway from the destination.\n\nIf the value for PacketsOutToSource is less than the value for PacketsInFromDestination, there may be data loss during NAT gateway processing, or traffic being actively blocked by the NAT gateway.", "interpretMethod": "expression", "interpretExpr": "if(and(un(PacketsInFromDestination_raw), eq(Status,0)),0,PacketsInFromDestination_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsInFromDestination_raw", "description": "The number of packets received by the NAT gateway from the destination.\n\nIf the value for PacketsOutToSource is less than the value for PacketsInFromDestination, there may be data loss during NAT gateway processing, or traffic being actively blocked by the NAT gateway.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>PacketsInFromDestination>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsInFromSource", "description": "The number of packets received by the NAT gateway from clients in your VPC.\n\nIf the value for PacketsOutToDestination is less than the value for PacketsInFromSource, there may be data loss during NAT gateway processing.", "interpretMethod": "expression", "interpretExpr": "if(and(un(PacketsInFromSource_raw), eq(Status,0)),0,PacketsInFromSource_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsInFromSource_raw", "description": "The number of packets received by the NAT gateway from clients in your VPC.\n\nIf the value for PacketsOutToDestination is less than the value for PacketsInFromSource, there may be data loss during NAT gateway processing.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>PacketsInFromSource>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsOutToDestination", "description": "The number of packets sent out through the NAT gateway to the destination.\n\nA value greater than zero indicates that there is traffic going to the internet from clients that are behind the NAT gateway. If the value for PacketsOutToDestination is less than the value for PacketsInFromSource, there may be data loss during NAT gateway", "interpretMethod": "expression", "interpretExpr": "if(and(un(PacketsOutToDestination_raw), eq(Status,0)),0,PacketsOutToDestination_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsOutToDestination_raw", "description": "The number of packets sent out through the NAT gateway to the destination.\n\nA value greater than zero indicates that there is traffic going to the internet from clients that are behind the NAT gateway. If the value for PacketsOutToDestination is less than the value for PacketsInFromSource, there may be data loss during NAT gateway", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>PacketsOutToDestination>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsOutToSource", "description": "The number of packets sent through the NAT gateway to the clients in your VPC.\n\nA value greater than zero indicates that there is traffic coming from the internet to clients that are behind the NAT gateway. If the value for PacketsOutToSource is less than the value for PacketsInFromDestination, there may be data loss during NAT gateway processing, or traffic being actively blocked by the NAT gateway.", "interpretMethod": "expression", "interpretExpr": "if(and(un(PacketsOutToSource_raw), eq(Status,0)),0,PacketsOutToSource_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsOutToSource_raw", "description": "The number of packets sent through the NAT gateway to the clients in your VPC.\n\nA value greater than zero indicates that there is traffic coming from the internet to clients that are behind the NAT gateway. If the value for PacketsOutToSource is less than the value for PacketsInFromDestination, there may be data loss during NAT gateway processing, or traffic being actively blocked by the NAT gateway.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>PacketsOutToSource>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Status", "description": "Returns the execution status of the query and ensures we keep a consistent collection interval without gaps in graph.", "interpretMethod": "none", "interpretExpr": "AWS/NATGateway>NatGatewayId:##system.aws.resourceid##>BytesInFromDestination>Average", "useValue": "status", "type": "status", "dataType": 2, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Active Connections", "title": "Active Connections", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ActiveConnectionCount", "datapointName": "ActiveConnectionCount", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Connections", "color": "fuchsia", "datapointName": "ActiveConnectionCount", "isVirtual": false}]}, {"name": "Connection Details", "title": "Connection Details", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ConnectionAttemptCount", "datapointName": "ConnectionAttemptCount", "consolidationFn": "average"}, {"name": "ConnectionEstablishedCount", "datapointName": "ConnectionEstablishedCount", "consolidationFn": "average"}, {"name": "IdleTimeoutCount", "datapointName": "IdleTimeoutCount", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Attempt", "color": "olive", "datapointName": "ConnectionAttemptCount", "isVirtual": false}, {"type": "line", "legend": "Established", "color": "navy", "datapointName": "ConnectionEstablishedCount", "isVirtual": false}, {"type": "line", "legend": "Idle Timeout", "color": "red2", "datapointName": "IdleTimeoutCount", "isVirtual": false}]}, {"name": "Errors", "title": "Errors", "verticalLabel": "count", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ErrorPortAllocation", "datapointName": "ErrorPortAllocation", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Port Allocation Errors", "color": "red2", "datapointName": "ErrorPortAllocation", "isVirtual": false}]}, {"name": "Packet Drop", "title": "Packet Drop", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PacketsDropCount", "datapointName": "PacketsDropCount", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Dropped Packets", "color": "orange", "datapointName": "PacketsDropCount", "isVirtual": false}]}, {"name": "Packet Transmission", "title": "Packet Transmission", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PacketsInFromDestination", "datapointName": "PacketsInFromDestination", "consolidationFn": "average"}, {"name": "PacketsInFromSource", "datapointName": "PacketsInFromSource", "consolidationFn": "average"}, {"name": "PacketsOutToDestination", "datapointName": "PacketsOutToDestination", "consolidationFn": "average"}, {"name": "PacketsOutToSource", "datapointName": "PacketsOutToSource", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Inbound From Destination", "color": "aqua", "datapointName": "PacketsInFromDestination", "isVirtual": false}, {"type": "stack", "legend": "Inbound From Source", "color": "silver", "datapointName": "PacketsInFromSource", "isVirtual": false}, {"type": "stack", "legend": "Outbound To Destination", "color": "lime", "datapointName": "PacketsOutToDestination", "isVirtual": false}, {"type": "stack", "legend": "Outbound To Source", "color": "green", "datapointName": "PacketsOutToSource", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "BytesInFromDestination", "datapointName": "BytesInFromDestination", "consolidationFn": "average"}, {"name": "BytesInFromSource", "datapointName": "BytesInFromSource", "consolidationFn": "average"}, {"name": "BytesOutToDestination", "datapointName": "BytesOutToDestination", "consolidationFn": "average"}, {"name": "BytesOutToSource", "datapointName": "BytesOutToSource", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Inbound From Destination", "color": "aqua", "datapointName": "BytesInFromDestination", "isVirtual": false}, {"type": "stack", "legend": "Inbound From Source", "color": "silver", "datapointName": "BytesInFromSource", "isVirtual": false}, {"type": "stack", "legend": "Outbound To Destination", "color": "lime", "datapointName": "BytesOutToDestination", "isVirtual": false}, {"type": "stack", "legend": "Outbound To Source", "color": "green", "datapointName": "BytesOutToSource", "isVirtual": false}]}]}

×DataSource: Microsoft_Azure_APIManagement (1629)

{"name": "Microsoft_Azure_APIManagement", "description": "Monitors Azure API Management namespace capacity, requests and gateway duration.", "appliesTo": "hasCategory(\"Azure/ApiManagement\")", "searchKeywords": "cloud,api,microsoft,azure", "technicalNotes": "API Management SKU Limits:\n- Developer - 500 requests/sec\n- Basic - 1,000 requests/sec\n- Standard - 2,500 requests/sec\n- Premium - 4,000 requests/sec", "displayedAs": "Azure API Management", "collectionInterval": "3m", "collectionMethod": "azureinsights", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "Capacity", "description": "Percent utilization of the API Management service gateway.\n\nBased on CPU and memory utilization.", "interpretMethod": "json", "interpretExpr": "Capacity.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "> 85 95", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Azure API Management Service ##HOST## is reporting that ##VALUE## % of its gateway capacity is utilized, placing the service into ##LEVEL## state.\n\nGateway capacity utilization is based on CPU and memory utilization. \n\nIf you are consistently receiving this alert, you may need to upgrade your service to a higher tier or reduce the number of requests.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "Duration", "description": "Overall Duration of Gateway Requests in milliseconds", "interpretMethod": "expression", "interpretExpr": "if(un(durationRaw),0, durationRaw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "FailedRequests", "description": "Number of failures in gateway requests since last polling interval.\n\nFailed requests are those that received erroneous HTTP response codes including 400(Bad Request) and anything larger than 500(Internal Server Error).", "interpretMethod": "expression", "interpretExpr": "if(un(failedRequestsRaw),0, failedRequestsRaw)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Azure API Management Service ##HOST## is consistently reporting failed requests. There have been ##VALUE## since the last polling interval, placing the service into ##LEVEL## state.\n\nFailed requests are those that received erroneous HTTP response codes including 400(Bad Request) and anything larger than 500(Internal Server Error).\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "OtherRequests", "description": "Number of other gateway requests since last polling interval.", "interpretMethod": "expression", "interpretExpr": "if(un(otherRequestsRaw),0, otherRequestsRaw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Status", "description": "Status code to ensure collection interval and data is returned by the Azure API.", "interpretMethod": "json", "interpretExpr": "TotalRequests.##primaryaggregation##", "useValue": "status", "type": "status", "dataType": 2, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SuccessfulRequests", "description": "Number of successful gateway requests", "interpretMethod": "expression", "interpretExpr": "if(un(successfulRequestsRaw),0, successfulRequestsRaw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalRequests", "description": "Number of gateway requests since last polling interval.", "interpretMethod": "expression", "interpretExpr": "if(un(totalRequestsRaw),0, totalRequestsRaw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UnauthorizedRequests", "description": "Number of unauthorized gateway requests.\n\nUnauthorized requests are those that received HTTP response codes including: \n401 - Unauthorized,\n403 - Forbidden,\n429 - Too Many Requests", "interpretMethod": "expression", "interpretExpr": "if(un(unauthorizedRequestsRaw),0, unauthorizedRequestsRaw)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Azure API Management Service ##HOST## is consistently reporting unauthorized requests,. There have been ##VALUE## since the last polling interval, placing the service into ##LEVEL## state.\n\nUnauthorized requests are those that received HTTP response codes including: \n401 - Unauthorized,\n403 - Forbidden,\n429 - Too Many Requests\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "durationRaw", "description": "Overall Duration of Gateway Requests in milliseconds", "interpretMethod": "json", "interpretExpr": "Duration.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "failedRequestsRaw", "description": "Number of failures in gateway requests", "interpretMethod": "json", "interpretExpr": "FailedRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "otherRequestsRaw", "description": "Number of other gateway requests", "interpretMethod": "json", "interpretExpr": "OtherRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "successfulRequestsRaw", "description": "Number of successful gateway requests", "interpretMethod": "json", "interpretExpr": "SuccessfulRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "totalRequestsRaw", "description": "Number of gateway requests", "interpretMethod": "json", "interpretExpr": "TotalRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "unauthorizedRequestsRaw", "description": "Number of unauthorized gateway requests", "interpretMethod": "json", "interpretExpr": "UnauthorizedRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Capacity", "title": "Capacity", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Capacity", "datapointName": "Capacity", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Capacity", "color": "orange2", "datapointName": "Capacity", "isVirtual": false}]}, {"name": "Duration", "title": "Duration", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Duration", "datapointName": "Duration", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Duration", "color": "lime", "datapointName": "Duration", "isVirtual": false}]}, {"name": "Requests", "title": "Requests", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "FailedRequests", "datapointName": "FailedRequests", "consolidationFn": "average"}, {"name": "OtherRequests", "datapointName": "OtherRequests", "consolidationFn": "average"}, {"name": "SuccessfulRequests", "datapointName": "SuccessfulRequests", "consolidationFn": "average"}, {"name": "TotalRequests", "datapointName": "TotalRequests", "consolidationFn": "average"}, {"name": "UnauthorizedRequests", "datapointName": "UnauthorizedRequests", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Failed", "color": "red", "datapointName": "FailedRequests", "isVirtual": false}, {"type": "stack", "legend": "Other", "color": "olive", "datapointName": "OtherRequests", "isVirtual": false}, {"type": "stack", "legend": "Successful", "color": "aqua", "datapointName": "SuccessfulRequests", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "TotalRequests", "isVirtual": false}, {"type": "stack", "legend": "Unauthorized", "color": "orange2", "datapointName": "UnauthorizedRequests", "isVirtual": false}]}]}

×DataSource: AWS_ElastiCache_Redis- (1832)

{"name": "AWS_ElastiCache_Redis-", "description": "Gathers Redis Node performance data as reported by CloudWatch. Per Amazon, minimum polling interval is 3m.", "appliesTo": "hasCategory(\"AWS/ElastiCache\") and system.aws.engine == \"redis\"", "searchKeywords": "cloud,amazon,aws,redis,elasticache", "technicalNotes": "- this module replaces 'AWS_ElastiCache_Redis' module which used 'CLOUDWATCH' discovery method.\n- Per Amazon, default polling interval of 1m.", "displayedAs": "ElastiCache Redis", "collectionInterval": "3m", "collectionMethod": "awscloudwatch", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_awselasticache", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "groupMethod": "none"}, "datapoints": [{"name": "BytesUsedForCache", "description": "The total number of bytes allocated by Redis.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>BytesUsedForCache>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "CacheEfficiency", "description": "Percentage of Successful Cache Hits", "interpretMethod": "expression", "interpretExpr": "if(eq(CacheHits,0),0,100*CacheHits/(CacheHits + CacheMisses))", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CacheHits", "description": "The number of successful key lookups per datacollection interval (1 min by default)", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>CacheHits>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "CacheMisses", "description": "The number of unsuccessful key lookups per datacollection interval (1 min by default)", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>CacheMisses>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ConnectionRate", "description": "Rate of at which new connections are added", "interpretMethod": "expression", "interpretExpr": "NewConnections/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrConnections", "description": "The number of client connections, excluding connections from read replicas.\n\nYou should set the threshold for this based on the needs of your application. An increasing number of CurrConnections could be indicative of a problem with your application.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>CurrConnections>Average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "CurrItems", "description": "The number of items in the cache.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>CurrItems>Average", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "Evictions", "description": "The number of keys that have been evicted due to the maxmemory limit.\n\nYou should set the threshold for this metric based on the needs of your application.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>Evictions>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "EvictionsRate", "description": "number of keys per second that have been evicted due to the maxmemory limit.", "interpretMethod": "expression", "interpretExpr": "Evictions/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "GetTypeCmds", "description": "This is sum of all the get types of commands (get, mget, hget, etc.)", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>GetTypeCmds>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "GetTypeCmdsRate", "description": "get types of commands per second.", "interpretMethod": "expression", "interpretExpr": "GetTypeCmds/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HashBasedCmds", "description": "The total number of commands that are hash-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more hashes.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>HashBasedCmds>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HashBasedCmdsRate", "description": "Hash based commands per second.", "interpretMethod": "expression", "interpretExpr": "HashBasedCmds/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HostCPUUtilization", "description": "The percentage of CPU utilization on the underlying host. \n\nSince Redis is single-threaded, an appropriate alert threshold would calculated as (90 / number of processor cores).", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>CPUUtilization>Average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HostFreeableMemory", "description": "The amount of free memory (bytes) available on the host", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>FreeableMemory>Average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HostNetworkBytesIn", "description": "The number of bytes the host has read from the network.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>NetworkBytesIn>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HostNetworkBytesOut", "description": "The number of bytes the host has written to the network.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>NetworkBytesOut>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HostNetworkInMbps", "description": "Incoming Network Throughput in Mbps", "interpretMethod": "expression", "interpretExpr": "8*HostNetworkBytesIn/(1000/1000)/##POLLINTERVAL##\n", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HostNetworkInbps", "description": "Incoming Network Throughput in bps", "interpretMethod": "expression", "interpretExpr": "8*HostNetworkBytesIn/##POLLINTERVAL##\n", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HostNetworkOutMbps", "description": "Outbound Network Throughput in Mbps", "interpretMethod": "expression", "interpretExpr": "8*HostNetworkBytesOut/(1000/1000)/##POLLINTERVAL##\n", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HostNetworkOutbps", "description": "Outbound Network Throughput in bps", "interpretMethod": "expression", "interpretExpr": "8*HostNetworkBytesOut/##POLLINTERVAL##\n", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HostSwapUsage", "description": "The amount of swap used (bytes) on the host.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>SwapUsage>Average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "KeyBasedCmds", "description": "The total number of commands that are key-based. Sum of the commands that act upon one or more keys.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>KeyBasedCmds>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "KeyBasedCmdsRate", "description": "Key based commands per second.", "interpretMethod": "expression", "interpretExpr": "KeyBasedCmds/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ListBasedCmds", "description": "The total number of commands that are list-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more lists.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>ListBasedCmds>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ListBasedCmdsRate", "description": "List based commands per second.", "interpretMethod": "expression", "interpretExpr": "ListBasedCmds/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NewConnections", "description": "The total number of connections that have been accepted by the server during this period.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>NewConnections>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "Reclaimed", "description": "The total number of key expiration events.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>Reclaimed>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ReclaimedRate", "description": "Rate of expiration events.", "interpretMethod": "expression", "interpretExpr": "Reclaimed/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ReplicationLag", "description": "Only applicable for a cache node running as a read replica. It represents how far behind, in seconds, the replica is in applying changes from the primary cache cluster.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>ReplicationLag>Average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 60", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The redis replica on ##HOST## ##INSTANCE## is now ##VALUE## seconds behind the master, putting it into a state of ##LEVEL##.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "SetBasedCmds", "description": "The total number of commands that are set-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more sets.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>SetBasedCmds>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SetBasedCmdsRate", "description": "set based commands per second.", "interpretMethod": "expression", "interpretExpr": "SetBasedCmds/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SetTypeCmds", "description": "Sum of the set types of commands (set, hset, etc.)", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>SetTypeCmds>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SetTypeCmdsRate", "description": "set types of commands per second.", "interpretMethod": "expression", "interpretExpr": "SetTypeCmds/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SortedSetBasedCmds", "description": "The total number of commands that are sorted set-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more sorted sets.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>SortedSetBasedCmds>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SortedSetBasedCmdsRate", "description": "Sorted set types of commands per second.", "interpretMethod": "expression", "interpretExpr": "SortedSetBasedCmds/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "StringBasedCmds", "description": "The total number of commands that are string-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more strings.", "interpretMethod": "none", "interpretExpr": "AWS/ElastiCache>CacheNodeId:##wildvalue##>CacheClusterId:##system.aws.resourceid##>StringBasedCmds>Sum", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "StringBasedCmdsRate", "description": "String Based commands per second.", "interpretMethod": "expression", "interpretExpr": "StringBasedCmds/##POLLINTERVAL##", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "CPU", "title": "CPU Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "HostCPUUtilization", "datapointName": "HostCPUUtilization", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilization", "color": "orange", "datapointName": "HostCPUUtilization", "isVirtual": false}]}, {"name": "Cache Efficiency", "title": "Cache Efficiency", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "CacheEfficiency", "datapointName": "CacheEfficiency", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Hit Ratio", "color": "fuchsia", "datapointName": "CacheEfficiency", "isVirtual": false}]}, {"name": "Cache Items", "title": "Cache Items", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "CurrItems", "datapointName": "CurrItems", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Current Items", "color": "blue", "datapointName": "CurrItems", "isVirtual": false}]}, {"name": "Cache Removal Events", "title": "Cache Removal Events", "verticalLabel": "items/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "Evictions", "datapointName": "EvictionsRate", "consolidationFn": "average"}, {"name": "Reclaimed", "datapointName": "ReclaimedRate", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Evictions", "color": "orange2", "datapointName": "Evictions", "isVirtual": false}, {"type": "area", "legend": "Expirations", "color": "red", "datapointName": "Reclaimed", "isVirtual": false}]}, {"name": "Command Types", "title": "Command Types", "verticalLabel": "commands/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "GetTypeCmds", "datapointName": "GetTypeCmdsRate", "consolidationFn": "average"}, {"name": "SetTypeCmds", "datapointName": "SetTypeCmdsRate", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Get", "color": "blue", "datapointName": "GetTypeCmds", "isVirtual": false}, {"type": "stack", "legend": "Set", "color": "fuchsia", "datapointName": "SetTypeCmds", "isVirtual": false}]}, {"name": "Commands by Basis", "title": "Commands by Basis", "verticalLabel": "commands/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "HashBasedCmds", "datapointName": "HashBasedCmdsRate", "consolidationFn": "average"}, {"name": "KeyBasedCmds", "datapointName": "KeyBasedCmdsRate", "consolidationFn": "average"}, {"name": "ListBasedCmds", "datapointName": "ListBasedCmdsRate", "consolidationFn": "average"}, {"name": "SetBasedCmds", "datapointName": "SetBasedCmdsRate", "consolidationFn": "average"}, {"name": "SortedSetBasedCmds", "datapointName": "SortedSetBasedCmdsRate", "consolidationFn": "average"}, {"name": "StringBasedCmds", "datapointName": "StringBasedCmdsRate", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Hash", "color": "orange", "datapointName": "HashBasedCmds", "isVirtual": false}, {"type": "stack", "legend": "Key", "color": "purple", "datapointName": "KeyBasedCmds", "isVirtual": false}, {"type": "stack", "legend": "List", "color": "green", "datapointName": "ListBasedCmds", "isVirtual": false}, {"type": "stack", "legend": "Set", "color": "teal", "datapointName": "SetBasedCmds", "isVirtual": false}, {"type": "stack", "legend": "Sorted Set", "color": "red", "datapointName": "SortedSetBasedCmds", "isVirtual": false}, {"type": "stack", "legend": "String", "color": "fuchsia", "datapointName": "StringBasedCmds", "isVirtual": false}]}, {"name": "Connection Rate", "title": "Connection Rate", "verticalLabel": "connections/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ConnectionRate", "datapointName": "ConnectionRate", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Connection Rate", "color": "lime", "datapointName": "ConnectionRate", "isVirtual": false}]}, {"name": "Connections", "title": "Connections", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Connections", "datapointName": "CurrConnections", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Connections", "color": "navy", "datapointName": "Connections", "isVirtual": false}]}, {"name": "Device Memory Use", "title": "Device Memory Use", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "HostFreeableMemory", "datapointName": "HostFreeableMemory", "consolidationFn": "average"}, {"name": "HostSwapUsage", "datapointName": "HostSwapUsage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Free Memory", "color": "blue", "datapointName": "HostFreeableMemory", "isVirtual": false}, {"type": "line", "legend": "Swap Usage", "color": "red", "datapointName": "HostSwapUsage", "isVirtual": false}]}, {"name": "Network Throughput", "title": "Network Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "networkIn", "datapointName": "HostNetworkInbps", "consolidationFn": "average"}, {"name": "networkOut", "datapointName": "HostNetworkOutbps", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Incoming", "color": "aqua", "datapointName": "networkIn", "isVirtual": false}, {"type": "stack", "legend": "Outgoing", "color": "olive", "datapointName": "networkOut", "isVirtual": false}]}, {"name": "Replication Lag", "title": "Replication Lag", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ReplicationLag", "datapointName": "ReplicationLag", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Lag", "color": "black", "datapointName": "ReplicationLag", "isVirtual": false}]}]}

×DataSource: Microsoft_Azure_ServiceBus (1620)

{"name": "Microsoft_Azure_ServiceBus", "description": "Monitors Azure Service Bus cloud messaging instance requests, messages, connections, cpu and memory usage.", "appliesTo": "hasCategory(\"Azure/ServiceBus\")", "searchKeywords": "cloud,microsoft,azure", "technicalNotes": "- CPUUsage and MemoryUsage datapoint metrics are only available with a Premium Azure SKU's.", "displayedAs": "Azure Service Bus", "collectionInterval": "3m", "collectionMethod": "azureinsights", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "ActiveConnections", "description": "Number of active connections on a namespace as well as on an entity.", "interpretMethod": "expression", "interpretExpr": "if(and(un(ActiveConnections_raw), eq(Status,0)),0,ActiveConnections_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ActiveConnections_raw", "description": "Number of active connections on a namespace as well as on an entity.", "interpretMethod": "json", "interpretExpr": "ActiveConnections.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CPUUsage", "description": "Percentage CPU usage of the namespace.\n\n-1 = Standard Service bus subscription. Metric only available with Premium SKU.", "interpretMethod": "expression", "interpretExpr": "if(and(un(CPUUsage_raw), eq(Status,0)),(1-2),CPUUsage_raw)", "type": "gauge", "dataType": 7, "min": "-1", "threshold": ">= 85 95", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Azure Service Bus ##HOST## is reporting high sustained CPU utilization of ##VALUE## % , placing the service bus into ##LEVEL# state.\n\nIf you are consistently receiving high CPU utilization alerts, you may want to upgraded your Service Bus messaging unit amount to handle the load. Azure offers 1, 2, or 4 messaging units for each Service Bus Premium namespace.\n\nhttps://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-premium-messaging\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "CPUUsage_raw", "description": "Percentage CPU usage of the namespace.\n\nMetrics only available with premium Azure subscriptions.", "interpretMethod": "json", "interpretExpr": "CPUXNS.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ConnectionsClosed", "description": "Number of connections closed.", "interpretMethod": "expression", "interpretExpr": "if(and(un(ConnectionsClosed_raw), eq(Status,0)),0,ConnectionsClosed_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ConnectionsClosed_raw", "description": "Number of connections closed.", "interpretMethod": "json", "interpretExpr": "ConnectionsClosed.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ConnectionsOpened", "description": "Number of connections opened.", "interpretMethod": "expression", "interpretExpr": "if(and(un(ConnectionsOpened_raw), eq(Status,0)),0,ConnectionsOpened_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ConnectionsOpened_raw", "description": "Number of connections opened.", "interpretMethod": "json", "interpretExpr": "ConnectionsOpened.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IncomingMessages", "description": "The number of events or messages sent to Service Bus over a specified period.", "interpretMethod": "expression", "interpretExpr": "if(and(un(IncomingMessages_raw), eq(Status,0)),0,IncomingMessages_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IncomingMessages_raw", "description": "The number of events or messages sent to Service Bus over a specified period.", "interpretMethod": "json", "interpretExpr": "IncomingMessages.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IncomingRequests", "description": "Number of requests made to the Service Bus service over a specified period.", "interpretMethod": "expression", "interpretExpr": "if(and(un(IncomingRequests_raw), eq(Status,0)),0,IncomingRequests_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IncomingRequests_raw", "description": "Number of requests made to the Service Bus service over a specified period.", "interpretMethod": "json", "interpretExpr": "IncomingRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemoryUsage", "description": "Percentage memory usage of the namespace.\n\n-1 = Standard Service bus subscription. Metric only available with Premium SKU.", "interpretMethod": "expression", "interpretExpr": "if(and(un(MemoryUsage_raw), eq(Status,0)),(1-2),MemoryUsage_raw)", "type": "gauge", "dataType": 7, "min": "-1", "threshold": ">= 85 95", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Azure Service Bus ##HOST## is reporting high sustained memory utilization of ##VALUE## % , placing the service bus into ##LEVEL# state.\n\nIf you are consistently receiving high memory utilization alerts, you may want to upgraded your Service Bus messaging unit amount to handle the load. Azure offers 1, 2, or 4 messaging units for each Service Bus Premium namespace.\n\nhttps://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-premium-messaging\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "MemoryUsage_raw", "description": "Percentage memory usage of the namespace.\n\nMetrics only available with premium Azure subscriptions.", "interpretMethod": "json", "interpretExpr": "WSXNS.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OutgoingMessages", "description": "The number of events or messages received from Service Bus over a specified period.", "interpretMethod": "expression", "interpretExpr": "if(and(un(OutgoingMessages_raw), eq(Status,0)),0,OutgoingMessages_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OutgoingMessages_raw", "description": "The number of events or messages received from Service Bus over a specified period.", "interpretMethod": "json", "interpretExpr": "OutgoingMessages.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServerErrors", "description": "Number of requests not processed due to an error in the Service Bus service over a specified period.", "interpretMethod": "expression", "interpretExpr": "if(and(un(ServerErrors_raw), eq(Status,0)),0,ServerErrors_raw)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Azure Service Bus ##HOST## has reported ##VALUE## server errors, placing the service bus into ##LEVEL# state.\n\nThese requests were not processed due to an error in the Service Bus.\n\nCommon service bus errors can be found here : https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-exceptions\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "ServerErrors_raw", "description": "Number of requests not processed due to an error in the Service Bus service over a specified period.", "interpretMethod": "json", "interpretExpr": "ServerErrors.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Status", "description": "Returns the status code of last data retrieval. Also ensures we have consistent data collection intervals.", "interpretMethod": "json", "interpretExpr": "ActiveConnections.##primaryaggregation##", "useValue": "status", "type": "status", "dataType": 2, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SuccessfulRequests", "description": "Number of successful requests made to the Service Bus service over a specified period.", "interpretMethod": "expression", "interpretExpr": "if(and(un(SuccessfulRequests_raw), eq(Status,0)),0,SuccessfulRequests_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SuccessfulRequests_raw", "description": "Number of successful requests made to the Service Bus service over a specified period.", "interpretMethod": "json", "interpretExpr": "SuccessfulRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ThrottledRequests", "description": "Number of requests that were throttled because the usage was exceeded.", "interpretMethod": "expression", "interpretExpr": "if(and(un(ThrottledRequests_raw), eq(Status,0)),0,ThrottledRequests_raw)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Azure Service Bus ##HOST## has been throttling ##VALUE## requests since its last polling interval due to subscription limitations, placing the service bus into ##LEVEL# state.\n\nRequests are throttled when the service bus subscription limit has been reached.\n\nIf you are consistently receiving throttle alerts, you may need to either upgrade your subscription to a higher tier to support the number of requests, or reduce the amount of service bus request.\n\nService Bus Tiering Information: https://azure.microsoft.com/en-us/pricing/details/service-bus/\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "ThrottledRequests_raw", "description": "Number of requests that were throttled because the usage was exceeded.", "interpretMethod": "json", "interpretExpr": "ThrottledRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UserErrors", "description": "Number of requests not processed due to user errors over a specified period.", "interpretMethod": "expression", "interpretExpr": "if(and(un(UserErrors_raw), eq(Status,0)),0,UserErrors_raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UserErrors_raw", "description": "Number of requests not processed due to user errors over a specified period.", "interpretMethod": "json", "interpretExpr": "UserErrors.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "CPU Usage", "title": "CPU Usage", "verticalLabel": "%", "min": -1.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CPUUsage", "datapointName": "CPUUsage", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "CPU Usage", "color": "orange2", "datapointName": "CPUUsage", "isVirtual": false}]}, {"name": "Connections", "title": "Connections", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ActiveConnections", "datapointName": "ActiveConnections", "consolidationFn": "average"}, {"name": "ConnectionsClosed", "datapointName": "ConnectionsClosed", "consolidationFn": "average"}, {"name": "ConnectionsOpened", "datapointName": "ConnectionsOpened", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "ActiveConnections", "color": "green", "datapointName": "ActiveConnections", "isVirtual": false}, {"type": "stack", "legend": "Closed", "color": "orange", "datapointName": "ConnectionsClosed", "isVirtual": false}, {"type": "stack", "legend": "Opened", "color": "navy", "datapointName": "ConnectionsOpened", "isVirtual": false}]}, {"name": "Errors", "title": "Errors", "verticalLabel": "count", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ServerErrors", "datapointName": "ServerErrors", "consolidationFn": "average"}, {"name": "UserErrors", "datapointName": "UserErrors", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Server Error", "color": "red", "datapointName": "ServerErrors", "isVirtual": false}, {"type": "stack", "legend": "User Error", "color": "orange2", "datapointName": "UserErrors", "isVirtual": false}]}, {"name": "Memory Usage", "title": "Memory Usage", "verticalLabel": "%", "min": -1.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "MemoryUsage", "datapointName": "MemoryUsage", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Memory Usage", "color": "fuchsia", "datapointName": "MemoryUsage", "isVirtual": false}]}, {"name": "Messages", "title": "Messages", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "IncomingMessages", "datapointName": "IncomingMessages", "consolidationFn": "average"}, {"name": "OutgoingMessages", "datapointName": "OutgoingMessages", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Incoming", "color": "silver", "datapointName": "IncomingMessages", "isVirtual": false}, {"type": "stack", "legend": "Outgoing", "color": "green", "datapointName": "OutgoingMessages", "isVirtual": false}]}, {"name": "Requests", "title": "Requests", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "IncomingRequests", "datapointName": "IncomingRequests", "consolidationFn": "average"}, {"name": "SuccessfulRequests", "datapointName": "SuccessfulRequests", "consolidationFn": "average"}, {"name": "ThrottledRequests", "datapointName": "ThrottledRequests", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "IncomingRequests", "color": "green", "datapointName": "IncomingRequests", "isVirtual": false}, {"type": "line", "legend": "Successful", "color": "navy", "datapointName": "SuccessfulRequests", "isVirtual": false}, {"type": "line", "legend": "Throttled", "color": "red", "datapointName": "ThrottledRequests", "isVirtual": false}]}]}

×DataSource: Ciena_WaveServer_Blades (1884)

{"name": "Ciena_WaveServer_Blades", "description": "Monitors the physical WaveServer blade operating & administrative states, as well as uptime, reason for last restart and chassis blade capabilities.", "appliesTo": "hasCategory(\"Ciena\")", "searchKeywords": "ciena,waveserver", "displayedAs": "WaveServer Blades", "collectionInterval": "2m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname');\n\n// collect all necessary properties in order to walk the oids.\ndef props = hostProps.toProperties().findAll { it.key.contains('snmp') };\n\ndef timeout = 20000 // 5 sec timeout\n\n// define maps we will walk.\ndef nameMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.5.3.1.2\", props, timeout);\ndef modelMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.5.3.1.3\", props, timeout);\ndef descriptionMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.5.3.1.4\", props, timeout);\ndef macAddrMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.5.3.1.7\", props, timeout);\n\ntry\n{\n nameMap.each\n { id, output ->\n\n println \"${id}##${output}##${descriptionMap[id]}####\" +\n \"auto.blade.model=${modelMap[id]}&\" +\n \"auto.blade.description=${descriptionMap[id]}&\" +\n \"auto.blade.mac_address=${macAddrMap[id]}\"\n }\n\n return 0;\n}\n\ncatch (Exception e)\n{\n println e;\n return 1;\n}\n\n"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname');\n\n// collect all necessary properties in order to walk the oids.\ndef props = hostProps.toProperties().findAll { it.key.contains('snmp') };\n\ndef timeout = 20000 // 5 sec timeout\n\n// define maps we will walk.\ndef nameMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.5.3.1.2\", props, timeout);\n\n// metrics\ndef adminStateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.5.4.1.2\", props, timeout);\ndef operationalStateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.5.4.1.3\", props, timeout);\ndef lastRestartDateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.5.4.1.4\", props, timeout);\ndef lastRestartReasonMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.5.4.1.5\", props, timeout);\n\ndef numberOfPortsMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.5.5.1.3\", props, timeout);\ndef numberOfChannelsMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.5.5.1.4\", props, timeout);\n\n// get current system epoch time.\nlong currentEpoch = System.currentTimeMillis() / 1000;\n\ntry\n{\n nameMap.each\n { id, output ->\n\n println \"${id}.adminState=${adminStateMap[id]}\"\n println \"${id}.operationalState=${operationalStateMap[id]}\"\n println \"${id}.lastRestartReason=${lastRestartReasonMap[id]}\"\n\n println \"${id}.numberOfPorts=${numberOfPortsMap[id]}\"\n println \"${id}.numberOfChannels=${numberOfChannelsMap[id]}\"\n\n // convert the human readable date into an epoch time.\n long lastRestartEpoch = new java.text.SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").parse(lastRestartDateMap[id]).getTime() / 1000;\n\n // determine uptime\n println \"${id}.uptime=\" + (currentEpoch - lastRestartEpoch)\n }\n\n return 0;\n}\n\ncatch (Exception e)\n{\n println e;\n return 1;\n}"}, "datapoints": [{"name": "adminState", "description": "Administrative state of the blade.\n\nStatus Codes:\n0=Enabled,\n1=Disabled,\n2=Shutdown", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.adminState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "lastRestartReason", "description": "Reason for most recent restart.\n\nStatus Codes:\n0=User Warm,\n1=User Cold,\n2=System Warm,\n3=System Cold,\n4=Power On", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.lastRestartReason", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numberOfChannels", "description": "Number of channels on the blade.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.numberOfChannels", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numberOfPorts", "description": "Number of ports on the blade.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.numberOfPorts", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operationalState", "description": "Operational state of the blade.\n\nStatus Codes:\n0=Up,\n1=Down,\n2=Faulted,\n3=Low Power Mode", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.operationalState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "uptime", "description": "Blade uptime, in seconds, since the last restart.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.uptime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "uptimeAlerting", "description": "Alerts if the WaveServer blade uptime is less than the polling interval, signifying a system restart had occurred.\n\nStatus Codes:\n0=Ok,\n1=Restarted", "interpretMethod": "expression", "interpretExpr": "if(lt(uptime,##POLLINTERVAL##),1,0)", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "= 1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Ciena WaveServer Blade ##INSTANCE## on ##HOST## has reported an uptime of only ##VALUE## second(s), meaning the blade has recently been restarted, placing the blade into ##LEVEL## state.\n\nIf the blade was restarted as part of planned maintenance, you may disregard this alert and/or place the host into SDT. Otherwise, please investigate why the blade was restarted.\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Administrative State", "title": "Administrative State", "verticalLabel": "status code", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "adminState", "datapointName": "adminState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Admin State", "color": "olive", "datapointName": "adminState", "isVirtual": false}]}, {"name": "Blade Capabilities", "title": "Blade Capabilities", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "numberOfChannels", "datapointName": "numberOfChannels", "consolidationFn": "average"}, {"name": "numberOfPorts", "datapointName": "numberOfPorts", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Channels", "color": "black", "datapointName": "numberOfChannels", "isVirtual": false}, {"type": "line", "legend": "Ports", "color": "fuchsia", "datapointName": "numberOfPorts", "isVirtual": false}]}, {"name": "Last Restart Reason", "title": "Last Restart Reason", "verticalLabel": "status code", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "lastRestartReason", "datapointName": "lastRestartReason", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Reason For Last Restart", "color": "orange2", "datapointName": "lastRestartReason", "isVirtual": false}]}, {"name": "Operational State", "title": "Operational State", "verticalLabel": "status code", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "operationalState", "datapointName": "operationalState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Operational State", "color": "aqua", "datapointName": "operationalState", "isVirtual": false}]}, {"name": "Uptime", "title": "Uptime", "verticalLabel": "day(s)", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "uptime", "datapointName": "uptime", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "uptime_days", "expr": "uptime / 60 / 60 / 24"}], "lines": [{"type": "line", "legend": "Uptime (days)", "color": "maroon", "datapointName": "uptime_days", "isVirtual": true}]}]}

×DataSource: Ciena_WaveServer_PhysicalTerminationPointChannels (1876)

{"name": "Ciena_WaveServer_PhysicalTerminationPointChannels", "description": "Monitors WaveServer Physical-Termination-Point (PTP) channel Rx / Tx optical power levels.", "appliesTo": "hasCategory(\"Ciena\")", "searchKeywords": "ciena,waveserver", "displayedAs": "WaveServer Physical Termination Point Channels", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname');\n\n// collect all necessary properties in order to walk the oids.\ndef props = hostProps.toProperties().findAll { it.key.contains('snmp') };\n\ndef timeout = 5000 // 5 sec timeout\n\n// define maps we will walk.\ndef rxPowerMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.11.1.2\", props, timeout);\n\ntry\n{\n rxPowerMap.each\n { index, output ->\n\n if (output.toString() != '-400') // -400 signifies the channel is off.\n {\n wildvalue = index.toString().replaceAll(/\\./, '_')\n\n ptpUnit = index.toString().split(/\\./)[0]\n ptpChannel = index.toString().split(/\\./)[1]\n\n println \"${wildvalue}##PTP: ${ptpUnit} - Channel: ${ptpChannel}######\" +\n \"auto.ptp.unit=${ptpUnit}&\" +\n \"auto.ptp.channel=${ptpChannel}\"\n }\n }\n\n return 0;\n}\n\ncatch (Exception e)\n{\n println e;\n return 1;\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname');\n\n// collect all necessary properties in order to walk the oids.\ndef props = hostProps.toProperties().findAll { it.key.contains('snmp') };\n\ndef timeout = 5000 // 5 sec timeout\n\n// define maps we will walk.\ndef rxPowerMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.11.1.2\", props, timeout);\ndef rxPowerMaxMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.11.1.3\", props, timeout);\ndef rxPowerMinMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.11.1.4\", props, timeout);\n\ndef txPowerMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.13.1.2\", props, timeout);\ndef txPowerMaxMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.13.1.3\", props, timeout);\ndef txPowerMinMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.13.1.4\", props, timeout);\n\ntry\n{\n rxPowerMap.each\n { index, output ->\n\n if (output.toString() != '-400') // -400 signifies the channel is off.\n {\n wildvalue = index.toString().replaceAll(/\\./, '_')\n\n println \"${wildvalue}.rxPower=${output}\"\n println \"${wildvalue}.rxPowerMax=${rxPowerMaxMap[index]}\"\n println \"${wildvalue}.rxPowerMin=${rxPowerMinMap[index]}\"\n\n println \"${wildvalue}.txPower=${txPowerMap[index]}\"\n println \"${wildvalue}.txPowerMax=${txPowerMaxMap[index]}\"\n println \"${wildvalue}.txPowerMin=${txPowerMinMap[index]}\"\n }\n }\n\n return 0;\n}\n\ncatch (Exception e)\n{\n println e;\n return 1;\n}"}, "datapoints": [{"name": "rxPower", "description": "Current Rx optical power, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rxPower", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rxPowerMax", "description": "Rx maximum power, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rxPowerMax", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rxPowerMin", "description": "Rx minimum power, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rxPowerMin", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "txPower", "description": "Current Tx optical power, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.txPower", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "txPowerMax", "description": "Tx maximum power, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.txPowerMax", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "txPowerMin", "description": "Tx minimum power, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.txPowerMin", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Rx Power", "title": "Rx Power", "verticalLabel": "dBm", "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "rxPower", "datapointName": "rxPower", "consolidationFn": "average"}, {"name": "rxPowerMax", "datapointName": "rxPowerMax", "consolidationFn": "average"}, {"name": "rxPowerMin", "datapointName": "rxPowerMin", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Rx", "color": "navy", "datapointName": "rxPower", "isVirtual": false}, {"type": "line", "legend": "Rx Maximum", "color": "orange", "datapointName": "rxPowerMax", "isVirtual": false}, {"type": "line", "legend": "Rx Minimum", "color": "green", "datapointName": "rxPowerMin", "isVirtual": false}]}, {"name": "Tx Power", "title": "Tx Power", "verticalLabel": "dBm", "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "txPower", "datapointName": "txPower", "consolidationFn": "average"}, {"name": "txPowerMax", "datapointName": "txPowerMax", "consolidationFn": "average"}, {"name": "txPowerMin", "datapointName": "txPowerMin", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Tx", "color": "green", "datapointName": "txPower", "isVirtual": false}, {"type": "line", "legend": "Tx Maximum", "color": "red2", "datapointName": "txPowerMax", "isVirtual": false}, {"type": "line", "legend": "Tx Minimum", "color": "fuchsia", "datapointName": "txPowerMin", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Ports by Rx Power", "title": "Top 10 Ports by Rx Power", "verticalLabel": "dBm", "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "rxPower", "datapointName": "rxPower", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "rxPower", "isVirtual": false}]}, {"name": "Top 10 Ports by Tx Power", "title": "Top 10 Ports by Tx Power", "verticalLabel": "dBm", "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "txPower", "datapointName": "txPower", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "txPower", "isVirtual": false}]}]}

×DataSource: Ciena_WaveServer_PhysicalTerminationPoints (1877)

{"name": "Ciena_WaveServer_PhysicalTerminationPoints", "description": "Monitors WaveServer Physical-Termination-Points (PTP) .", "appliesTo": "hasCategory(\"Ciena\")", "searchKeywords": "ciena,waveserver", "displayedAs": "WaveServer Physical Termination Points", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname');\n\n// collect all necessary properties in order to walk the oids.\ndef props = hostProps.toProperties().findAll { it.key.contains('snmp') };\n\ndef timeout = 5000 // 5 sec timeout\n\n// define maps we will walk.\ndef nameMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.4.1.2\", props, timeout);\n\ndef xcvrTypeMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.6.1.2\", props, timeout);\ndef parentIndexMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.6.1.3\", props, timeout);\ndef lineRateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.6.1.4\", props, timeout);\n\nMap types =\n[\n'0': 'Not Available',\n'1': 'Unsupported',\n'2': 'QSFP%2B',\n'3': 'QSFP28',\n'4': 'Wavelogic3 Extreme'\n]\n\nMap line_rates =\n[\n'0': 'None',\n'1': '10.3125 Gbps',\n'2': '41.25 Gbps',\n'3': '103.125 Gbps',\n'4': '2xOTU4',\n'5': '1xOTU4'\n]\n\ntry\n{\n nameMap.each\n { index, name ->\n\n println \"${index}##${name}######\" +\n \"auto.ptp.name=${name}&\" +\n \"auto.ptp.xcvr_type=${types[xcvrTypeMap[index]]}&\" +\n \"auto.ptp.parent=Transceiver ${parentIndexMap[index]}&\" +\n \"auto.ptp.line_rate=${line_rates[lineRateMap[index]]}\"\n }\n\n return 0;\n}\n\ncatch (Exception e)\n{\n println e;\n return 1;\n}\n\n"}, "groupMethod": "ilp", "groupExpr": "auto.ptp.parent"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname');\n\n// collect all necessary properties in order to walk the oids.\ndef props = hostProps.toProperties().findAll { it.key.contains('snmp') };\n\ndef timeout = 5000 // 5 sec timeout\n\n// define maps we will walk.\ndef nameMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.4.1.2\", props, timeout);\n\ndef adminStateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.5.1.2\", props, timeout);\ndef operationalStateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.5.1.3\", props, timeout);\ndef transmitterStateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.7.1.2\", props, timeout);\n\ndef wavelengthValMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.8.1.2\", props, timeout);\ndef wavelengthMinMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.8.1.3\", props, timeout);\ndef wavelengthMaxMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.8.1.4\", props, timeout);\ndef wavelengthActualMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.8.8.1.5\", props, timeout);\n\ntry\n{\n nameMap.each\n { index, name ->\n\n println \"${index}.adminState=${adminStateMap[index]}\"\n println \"${index}.operatingState=${operationalStateMap[index]}\"\n println \"${index}.transmitterState=${transmitterStateMap[index]}\"\n\n println \"${index}.wavelengthVal=${wavelengthValMap[index]}\"\n println \"${index}.wavelengthMin=${wavelengthMinMap[index]}\"\n println \"${index}.wavelengthMax=${wavelengthMaxMap[index]}\"\n println \"${index}.wavelengthActual=${wavelengthActualMap[index]}\"\n }\n\n return 0;\n}\n\ncatch (Exception e)\n{\n println e;\n return 1;\n}"}, "datapoints": [{"name": "adminState", "description": "Current administrative state.\n\nStatus Codes:\n0=disabled,\n1=enabled", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.adminState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operatingState", "description": "Current operational state.\n\nStatus Codes:\n0=up, \n1=down,\n2=tuning,\n3=fault,\n4=unknown", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.operatingState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "4", "threshold": ">= 3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Physical Termination Point (PTP) ##INSTANCE## (##auto.ptp.parent## : ##auto.ptp.xcvr_type##) on Ciena WaveServer ##HOST## has reported a status of ##VALUE##, placing it into ##LEVEL## state.\n\n\nStatus Codes are as follows:\n0=up, \n1=down,\n2=tuning,\n3=fault,\n4=unknown\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "transmitterState", "description": "Current transmitter state.\n\nStatus Codes:\n0=disabled,\n1=enabled,\n2=N/A", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.transmitterState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "wavelengthActual", "description": "Actual wavelength of the PTP, in nanometers.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.wavelengthActual", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "wavelengthMax", "description": "Maximum wavelength of the PTP, in nanometers.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.wavelengthMax", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "wavelengthMin", "description": "Minimum wavelength of the PTP, in nanometers.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.wavelengthMin", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "wavelengthVal", "description": "Configured wavelength of the PTP, in nanometers.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.wavelengthVal", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Admin State", "title": "Admin State", "verticalLabel": "0=disabled, 1=enabled", "min": -1.0, "max": 2.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "adminState", "datapointName": "adminState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Admin State", "color": "fuchsia", "datapointName": "adminState", "isVirtual": false}]}, {"name": "Operating State", "title": "Operating State", "verticalLabel": "status code", "min": -1.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "operatingState", "datapointName": "operatingState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Operating State", "color": "olive", "datapointName": "operatingState", "isVirtual": false}]}, {"name": "Transmitter State", "title": "Transmitter State", "verticalLabel": "0=disabled, 1=enabled", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "transmitterState", "datapointName": "transmitterState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Transmitter State", "color": "silver", "datapointName": "transmitterState", "isVirtual": false}]}, {"name": "Wavelength", "title": "Wavelength", "verticalLabel": "nanometers", "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "wavelengthActual", "datapointName": "wavelengthActual", "consolidationFn": "average"}, {"name": "wavelengthMax", "datapointName": "wavelengthMax", "consolidationFn": "average"}, {"name": "wavelengthMin", "datapointName": "wavelengthMin", "consolidationFn": "average"}, {"name": "wavelengthVal", "datapointName": "wavelengthVal", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Actual", "color": "navy", "datapointName": "wavelengthActual", "isVirtual": false}, {"type": "line", "legend": "Maximum", "color": "red", "datapointName": "wavelengthMax", "isVirtual": false}, {"type": "line", "legend": "Minimum", "color": "green", "datapointName": "wavelengthMin", "isVirtual": false}, {"type": "line", "legend": "Configured", "color": "black", "datapointName": "wavelengthVal", "isVirtual": false}]}]}

×DataSource: Ciena_WaveServer_Ports (1878)

{"name": "Ciena_WaveServer_Ports", "description": "Monitors WaveServer port operating state, admin state, and transition changes.", "appliesTo": "hasCategory(\"Ciena\")", "searchKeywords": "ciena,waveserver", "displayedAs": "WaveServer Ports", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname');\n\n// collect all necessary properties in order to walk the oids.\ndef props = hostProps.toProperties().findAll { it.key.contains('snmp') };\n\ndef timeout = 20000 // 20 sec timeout\n\n// define maps we will walk.\ndef nameMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.7.4.1.2\", props, timeout);\ndef descriptionMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.7.4.1.3\", props, timeout);\ndef portTypeMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.7.4.1.4\", props, timeout);\ndef macAddrMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.7.4.1.5\", props, timeout);\ndef interfaceTypeMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.7.4.1.6\", props, timeout);\n\nMap portTypes =\n[\n'5': 'Unknown',\n'6': '10 Gb Ethernet',\n'7': '40 Gb Ethernet',\n'8': '100 Gb Ethernet'\n]\n\nMap interfaceTypes =\n[\n'0': 'INNI : Internal Node-to-Node',\n'1': 'UNI : User Network Interface',\n'2': 'ENNI : External Network-to-Network'\n]\n\ntry\n{\n nameMap.each\n { id, output ->\n\n wildvalue = id.toString().replaceAll(/\\./, '_')\n\n println \"${wildvalue}##${output}##${descriptionMap[id]}####\" +\n \"auto.port.name=${nameMap[id]}&\" +\n \"auto.port.description=${descriptionMap[id]}&\" +\n \"auto.port.type=${portTypes[portTypeMap[id]]}&\" +\n \"auto.port.mac_address=${macAddrMap[id]}&\" +\n \"auto.port.interface_type=${interfaceTypes[interfaceTypeMap[id]]}\"\n }\n\n return 0;\n}\n\ncatch (Exception e)\n{\n println e;\n return 1;\n}\n\n"}, "groupMethod": "ilp", "groupExpr": "auto.port.type"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname');\n\n// collect all necessary properties in order to walk the oids.\ndef props = hostProps.toProperties().findAll { it.key.contains('snmp') };\n\ndef timeout = 20000 // 20 sec timeout\n\n// define maps we will walk.\ndef nameMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.7.4.1.2\", props, timeout);\n\n//\ndef adminStateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.7.5.1.2\", props, timeout);\ndef operatingStateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.7.5.1.3\", props, timeout);\ndef timeSinceLastTransitionMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.7.5.1.4\", props, timeout);\n\ntry\n{\n nameMap.each\n { id, output ->\n\n wildvalue = id.toString().replaceAll(/\\./, '_')\n\n // parse the time.\n regex = '''(\\\\d+)d(\\\\d+)h(\\\\d+)m(\\\\d+)s'''\n lastTransition = (timeSinceLastTransitionMap[id]).toString().replaceAll(/\\s+/, '')\n pattern = ~regex\n matcher = pattern.matcher(lastTransition);\n\n // match it to calculate the time.\n days = matcher[0][1].toInteger()\n hours = matcher[0][2].toInteger()\n minutes = matcher[0][3].toInteger()\n seconds = matcher[0][4].toInteger()\n\n // get aggregate time since last change.\n total_time = ((days * 24 * 60 * 60) + (hours * 60 * 60) + (minutes * 60) + seconds)\n\n println \"${wildvalue}.adminState=${adminStateMap[id]}\"\n println \"${wildvalue}.operatingState=${operatingStateMap[id]}\"\n println \"${wildvalue}.secondsSinceLastStateTransition=${total_time}\"\n }\n\n return 0;\n}\n\ncatch (Exception e)\n{\n println e;\n return 1;\n}"}, "datapoints": [{"name": "adminState", "description": "Administrative state of the port.\n\nStatus Codes:\n1=Enabled,\n2=Disabled", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.adminState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operatingState", "description": "Current operating state of the port.\n\nStatus Codes:\n-1=Unknown,\n0=Invalid,\n1=Up,\n2=Down,\n3=Not Authenticated,\n4=Loop Back Tx,\n5=Loop Back Rx,\n6=Unequipped", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.operatingState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "threshold": ">= 3", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Port ##INSTANCE## (##auto.port.type## : ##auto.port.description##) on Ciena WaveServer ##HOST## is longer in a normal operating state, reporting a status code of ##VALUE##, placing the port into ##LEVEL## state.\n\nStatus Codes:\n-1=Unknown,\n0=Invalid,\n1=Up,\n2=Down,\n3=Not Authenticated,\n4=Loop Back Tx,\n5=Loop Back Rx,\n6=Unequipped\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "secondsSinceLastStateTransition", "description": "Amount of time, in seconds, since the last operational state change.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.secondsSinceLastStateTransition", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Administrative State", "title": "Administrative State", "verticalLabel": "1=enabled, 2=disabled", "min": -2.0, "max": 4.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "adminState", "datapointName": "adminState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Admin State", "color": "blue", "datapointName": "adminState", "isVirtual": false}]}, {"name": "Last State Change", "title": "Last State Change", "verticalLabel": "days(s)", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "secondsSinceLastStateTransition", "datapointName": "secondsSinceLastStateTransition", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "daysSinceLastStateTransition", "expr": "secondsSinceLastStateTransition / 60 / 60 / 24"}], "lines": [{"type": "line", "legend": "Last State Change", "color": "orange2", "datapointName": "daysSinceLastStateTransition", "isVirtual": true}]}, {"name": "Operating State", "title": "Operating State", "verticalLabel": "status code", "min": -2.0, "max": 7.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "operatingState", "datapointName": "operatingState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Operating State", "color": "olive", "datapointName": "operatingState", "isVirtual": false}]}]}

×DataSource: Ciena_WaveServer_TransceiverChannels (1881)

{"name": "Ciena_WaveServer_TransceiverChannels", "description": "Monitors the Rx/Tx power levels on the transceiver channels.", "appliesTo": "hasCategory(\"Ciena\")", "searchKeywords": "ciena,waveserver", "displayedAs": "WaveServer Transceiver Channels", "collectionInterval": "1m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname');\n\n// collect all necessary properties in order to walk the oids.\ndef props = hostProps.toProperties().findAll { it.key.contains('snmp') };\n\ndef timeout = 10000 // 10 sec timeout\n\n// define maps we will walk.\ndef rxPowerMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.17.1.2\", props, timeout);\n\ntry\n{\n rxPowerMap.each\n { id, output ->\n\n if (output.toString() != '-400') // -400 signifies the channel is off.\n {\n wildvalue = id.toString().replaceAll(/\\./, '_')\n\n xcvrUnit = id.toString().split(/\\./)[0]\n xcvrChannel = id.toString().split(/\\./)[1]\n\n println \"${wildvalue}##Transceiver ${xcvrUnit} - Channel ${xcvrChannel}######\" +\n \"auto.xcvr.unit=${xcvrUnit}&\" +\n \"auto.xcvr.channel=${xcvrChannel}\"\n }\n }\n\n return 0;\n}\n\ncatch (Exception e)\n{\n println e;\n return 1;\n}"}, "groupMethod": "ilp", "groupExpr": "auto.xcvr.unit"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname');\n\n// collect all necessary properties in order to walk the oids.\ndef props = hostProps.toProperties().findAll { it.key.contains('snmp') };\n\ndef timeout = 10000 // 10 sec timeout\n\n// define maps we will walk.\ndef rxPowerMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.17.1.2\", props, timeout);\ndef rxPowerHighAlarmThresholdMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.19.1.2\", props, timeout);\ndef rxPowerLowAlarmThresholdMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.19.1.3\", props, timeout);\ndef rxPowerHighWarningThresholdMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.19.1.4\", props, timeout);\ndef rxPowerLowWarningThresholdMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.19.1.5\", props, timeout);\n\ndef txPowerMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.20.1.2\", props, timeout);\ndef txPowerHighAlarmThresholdMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.22.1.2\", props, timeout);\ndef txPowerLowAlarmThresholdMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.22.1.3\", props, timeout);\ndef txPowerHighWarningThresholdMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.22.1.4\", props, timeout);\ndef txPowerLowWarningThresholdMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.22.1.5\", props, timeout);\n\ntry\n{\n rxPowerMap.each\n { id, output ->\n\n if (output.toString() != '-400') // -400 signifies the channel is off.\n {\n wildvalue = id.toString().replaceAll(/\\./, '_')\n\n println \"${wildvalue}.rxPower=${output}\"\n println \"${wildvalue}.rxPowerHighAlarmThreshold=${rxPowerHighAlarmThresholdMap[id]}\"\n println \"${wildvalue}.rxPowerLowAlarmThreshold=${rxPowerLowAlarmThresholdMap[id]}\"\n println \"${wildvalue}.rxPowerHighWarningThreshold=${rxPowerHighWarningThresholdMap[id]}\"\n println \"${wildvalue}.rxPowerLowWarningThreshold=${rxPowerLowWarningThresholdMap[id]}\"\n\n println \"${wildvalue}.txPower=${txPowerMap[id]}\"\n println \"${wildvalue}.txPowerHighAlarmThreshold=${txPowerHighAlarmThresholdMap[id]}\"\n println \"${wildvalue}.txPowerLowAlarmThreshold=${txPowerLowAlarmThresholdMap[id]}\"\n println \"${wildvalue}.txPowerHighWarningThreshold=${txPowerHighWarningThresholdMap[id]}\"\n println \"${wildvalue}.txPowerLowWarningThreshold=${txPowerLowWarningThresholdMap[id]}\"\n }\n }\n\n return 0;\n}\n\ncatch (Exception e)\n{\n println e;\n return 1;\n}"}, "datapoints": [{"name": "rxPower", "description": "Channel Rx power, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rxPower", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rxPowerHighAlarmThreshold", "description": "High alarm Rx power threshold, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rxPowerHighAlarmThreshold", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rxPowerHighWarningThreshold", "description": "High warning Rx power threshold, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rxPowerHighWarningThreshold", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rxPowerLowAlarmThreshold", "description": "Low alarm Rx power threshold, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rxPowerLowAlarmThreshold", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rxPowerLowWarningThreshold", "description": "Low warning Rx power threshold, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rxPowerLowWarningThreshold", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rxThresholdAlert", "description": "Alerts if the Rx thresholds low/high are surpassed.\n\nStatus Codes:\n0=Ok,\n1=Lower Bound Threshold Exceeded,\n2=High Bound Threshold Exceeded", "interpretMethod": "expression", "interpretExpr": "if(lt(rxPower,rxPowerLowAlarmThreshold),1, 0) || if(gt(rxPower,rxPowerHighAlarmThreshold),2, 0)", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Transceiver Channel ##INSTANCE## on Ciena WaveServer ##HOST## has reported that its Rx power levels are no longer within optimal operating bounds and is reporting a status code of ##VALUE##, placing the channel into ##LEVEL## state.\n\nStatus Codes:\n0=Ok,\n1=Lower Bound Threshold Exceeded,\n2=High Bound Threshold Exceeded\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "txPower", "description": "Channel Tx power, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.txPower", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "txPowerHighAlarmThreshold", "description": "High alarm Tx power threshold, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.txPowerHighAlarmThreshold", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "txPowerHighWarningThreshold", "description": "High warning Tx power threshold, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.txPowerHighWarningThreshold", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "txPowerLowAlarmThreshold", "description": "Low alarm Tx power threshold, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.txPowerLowAlarmThreshold", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "txPowerLowWarningThreshold", "description": "Low warning Tx power threshold, in dBm.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.txPowerLowWarningThreshold", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "txThresholdAlert", "description": "Alerts if the Tx thresholds low/high are surpassed.\n\nStatus Codes:\n0=Ok,\n1=Lower Bound Threshold Exceeded,\n2=High Bound Threshold Exceeded", "interpretMethod": "expression", "interpretExpr": "if(lt(txPower,txPowerLowAlarmThreshold),1, 0) || if(gt(txPower,txPowerHighAlarmThreshold),2, 0)", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Transceiver Channel ##INSTANCE## on Ciena WaveServer ##HOST## has reported that its Tx power levels are no longer within optimal operating bounds and is reporting a status code of ##VALUE##, placing the channel into ##LEVEL## state.\n\nStatus Codes:\n0=Ok,\n1=Lower Bound Threshold Exceeded,\n2=High Bound Threshold Exceeded\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Rx Power", "title": "Rx Power", "verticalLabel": "dBm", "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "rxPower", "datapointName": "rxPower", "consolidationFn": "average"}, {"name": "rxPowerHighAlarmThreshold", "datapointName": "rxPowerHighAlarmThreshold", "consolidationFn": "average"}, {"name": "rxPowerHighWarningThreshold", "datapointName": "rxPowerHighWarningThreshold", "consolidationFn": "average"}, {"name": "rxPowerLowAlarmThreshold", "datapointName": "rxPowerLowAlarmThreshold", "consolidationFn": "average"}, {"name": "rxPowerLowWarningThreshold", "datapointName": "rxPowerLowWarningThreshold", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Rx Power", "color": "navy", "datapointName": "rxPower", "isVirtual": false}, {"type": "line", "legend": "High Alarm Threshold", "color": "red", "datapointName": "rxPowerHighAlarmThreshold", "isVirtual": false}, {"type": "line", "legend": "High Warning Threshold", "color": "orange2", "datapointName": "rxPowerHighWarningThreshold", "isVirtual": false}, {"type": "line", "legend": "Low Alarm Threshold", "color": "green", "datapointName": "rxPowerLowAlarmThreshold", "isVirtual": false}, {"type": "line", "legend": "Low Warning Threshold", "color": "lime", "datapointName": "rxPowerLowWarningThreshold", "isVirtual": false}]}, {"name": "Tx Power", "title": "Tx Power", "verticalLabel": "dBm", "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "txPower", "datapointName": "txPower", "consolidationFn": "average"}, {"name": "txPowerHighAlarmThreshold", "datapointName": "txPowerHighAlarmThreshold", "consolidationFn": "average"}, {"name": "txPowerHighWarningThreshold", "datapointName": "txPowerHighWarningThreshold", "consolidationFn": "average"}, {"name": "txPowerLowAlarmThreshold", "datapointName": "txPowerLowAlarmThreshold", "consolidationFn": "average"}, {"name": "txPowerLowWarningThreshold", "datapointName": "txPowerLowWarningThreshold", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Tx Power", "color": "fuchsia", "datapointName": "txPower", "isVirtual": false}, {"type": "line", "legend": "High Alarm Threshold", "color": "red", "datapointName": "txPowerHighAlarmThreshold", "isVirtual": false}, {"type": "line", "legend": "High Warning Threshold", "color": "orange2", "datapointName": "txPowerHighWarningThreshold", "isVirtual": false}, {"type": "line", "legend": "Low Alarm Threshold", "color": "green", "datapointName": "txPowerLowAlarmThreshold", "isVirtual": false}, {"type": "line", "legend": "Low Warning Threshold", "color": "lime", "datapointName": "txPowerLowWarningThreshold", "isVirtual": false}]}]}

×DataSource: Ciena_WaveServer_Transceivers (1883)

{"name": "Ciena_WaveServer_Transceivers", "description": "Monitors WaveServer transceiver temperature, voltage and various states such as power, operational and administrative.", "appliesTo": "hasCategory(\"Ciena\")", "searchKeywords": "ciena,waveserver", "displayedAs": "WaveServer Transceivers", "collectionInterval": "2m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname');\n\n// collect all necessary properties in order to walk the oids.\ndef props = hostProps.toProperties().findAll { it.key.contains('snmp') };\n\ndef timeout = 5000 // 5 sec timeout\n\n// define maps we will walk.\ndef nameMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.4.1.2\", props, timeout);\ndef descriptionMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.4.1.3\", props, timeout);\n\ndef typeMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.6.1.2\", props, timeout);\ndef modeMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.6.1.3\", props, timeout);\ndef channelsMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.6.1.4\", props, timeout);\n\ndef vendorNameMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.9.1.2\", props, timeout);\ndef vendorPartNumberMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.9.1.3\", props, timeout);\ndef vendorSerialNumberMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.9.1.5\", props, timeout);\ndef vendorManufacturedDateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.9.1.6\", props, timeout);\n\nMap propTypes =\n[\n'0': 'Not Available',\n'1': 'Unsupported',\n'2': 'QSFP%2B',\n'3': 'QSFP28',\n'4': 'Wavelogic3 Extreme'\n]\n\nMap propMode =\n[\n'0': 'Blank',\n'1': '10 Gb',\n'2': '40 Gb',\n'3': '100 Gb',\n'4': '16-QAM',\n'5': 'QPSK',\n'6': '8-QAM',\n]\n\ntry\n{\n nameMap.each\n { id, output ->\n\n if (vendorSerialNumberMap[id])\n {\n println \"${id}##${output}##${propMode[modeMap[id]]} : ${descriptionMap[id]}####\" +\n \"auto.xcvr.name=${nameMap[id]}&\" +\n \"auto.xcvr.description=${descriptionMap[id]}&\" +\n \"auto.xcvr.type=${propTypes[typeMap[id]]}&\" +\n \"auto.xcvr.mode=${propMode[modeMap[id]]}&\" +\n \"auto.xcvr.number_of_channels=${channelsMap[id]}&\" +\n \"auto.xcvr.vendor.name=${vendorNameMap[id]}&\" +\n \"auto.xcvr.vendor.part_number=${vendorPartNumberMap[id].toString().replaceAll(/\\s+/, '')}&\" +\n \"auto.xcvr.vendor.serial_number=${vendorSerialNumberMap[id].toString().replaceAll(/\\s+/, '')}&\" +\n \"auto.xcvr.vendor.manufactured_date=${vendorManufacturedDateMap[id].toString().replaceAll(/\\s+/, '')}\"\n }\n }\n\n return 0;\n}\n\ncatch (Exception e)\n{\n println e;\n return 1;\n}\n\n"}, "groupMethod": "ilp", "groupExpr": "auto.xcvr.type"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname');\n\n// collect all necessary properties in order to walk the oids.\ndef props = hostProps.toProperties().findAll { it.key.contains('snmp') };\n\ndef timeout = 20000 // 10 sec timeout\n\n// define maps we will walk.\ndef nameMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.4.1.2\", props, timeout);\n\n// States\ndef adminStateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.5.1.2\", props, timeout);\ndef operationalStateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.5.1.3\", props, timeout);\ndef powerStateMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.5.1.4\", props, timeout);\n\n// Temperature\ndef currentTemperatureMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.13.1.2\", props, timeout);\ndef tempHighAlarmThresholdMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.15.1.2\", props, timeout);\ndef tempHighWarningThresholdMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.15.15.1.4\", props, timeout);\n\ndef voltageMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1271.3.4.17.11.1.2\", props, timeout);\n\ntry\n{\n nameMap.each\n { id, output ->\n\n println \"${id}.adminState=${adminStateMap[id]}\"\n println \"${id}.operationalState=${operationalStateMap[id]}\"\n println \"${id}.powerState=${powerStateMap[id]}\"\n\n println \"${id}.currentTemperature=${currentTemperatureMap[id]}\"\n println \"${id}.tempHighAlarmThreshold=${tempHighAlarmThresholdMap[id]}\"\n println \"${id}.tempHighWarningThreshold=${tempHighWarningThresholdMap[id]}\"\n\n println \"${id}.voltage=\" + (voltageMap[id].toInteger() / 100)\n\n }\n\n return 0;\n}\n\ncatch (Exception e)\n{\n println e;\n return 1;\n}"}, "datapoints": [{"name": "adminState", "description": "Administrative state.\n\nStatus Codes:\n0=Disabled,\n1=Enabled", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.adminState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "currentTemperature", "description": "Current temperature reading, in degrees Celsius.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.currentTemperature", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operationalState", "description": "Operational state of the transceiver.\n\nStatus Codes:\n0=Empty,\n1=Up,\n2=Down,\n3=Uncertified,\n4=Low Power Mode,\n5=Unknown", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.operationalState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "5", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "powerState", "description": "Power state of the transceiver.\n\nStatus Codes:\n0=Normal,\n1=Low Power", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.powerState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "delta>= 1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "XCVR Transceiver ##INSTANCE## (##DSIDESCRIPTION##) on Ciena WaveServer ##HOST## has changed power state from normal to low power mode, placing the transceiver into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "tempHighAlarmThreshold", "description": "High temperature alarm threshold, in degrees Celsius.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.tempHighAlarmThreshold", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "tempHighWarningThreshold", "description": "High temperature warning threshold, in degrees Celsius.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.tempHighWarningThreshold", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "temperatureErrorAlerting", "description": "Alerts warning if the current temperature reading surpasses the configured alarm thresholds.", "interpretMethod": "expression", "interpretExpr": "if(lt(currentTemperature,tempHighAlarmThreshold),0,tempHighAlarmThreshold)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 0 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Transceiver ##INSTANCE## (##DSIDESCRIPTION##) on Ciena WaveServer ##HOST## has surpassed the alarm temperature threshold, and is reporting a temperature of ##VALUE## \u00b0C , placing the transceiver into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "temperatureWarningAlerting", "description": "Alerts warning if the current temperature reading surpasses the configured warning thresholds.", "interpretMethod": "expression", "interpretExpr": "if(lt(currentTemperature,tempHighWarningThreshold),0,currentTemperature)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Transceiver ##INSTANCE## (##DSIDESCRIPTION##) on Ciena WaveServer ##HOST## has surpassed the warning temperature threshold, and is reporting a temperature of ##VALUE## \u00b0C , placing the transceiver into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "voltage", "description": "Transceiver supplied power, in volts.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.voltage", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Administrative State", "title": "Administrative State", "verticalLabel": "status code", "min": -1.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "adminState", "datapointName": "adminState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Admin State", "color": "navy", "datapointName": "adminState", "isVirtual": false}]}, {"name": "Operational State", "title": "Operational State", "verticalLabel": "status code", "min": -1.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "operationalState", "datapointName": "operationalState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Operating State", "color": "fuchsia", "datapointName": "operationalState", "isVirtual": false}]}, {"name": "Power State", "title": "Power State", "verticalLabel": "status code", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "powerState", "datapointName": "powerState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Power State", "color": "lime", "datapointName": "powerState", "isVirtual": false}]}, {"name": "Temperature", "title": "Temperature", "verticalLabel": "\u00b0C", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "currentTemperature", "datapointName": "currentTemperature", "consolidationFn": "average"}, {"name": "tempHighAlarmThreshold", "datapointName": "tempHighAlarmThreshold", "consolidationFn": "average"}, {"name": "tempHighWarningThreshold", "datapointName": "tempHighWarningThreshold", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Current Temperature", "color": "green", "datapointName": "currentTemperature", "isVirtual": false}, {"type": "line", "legend": "High Alarm Threshold", "color": "red", "datapointName": "tempHighAlarmThreshold", "isVirtual": false}, {"type": "line", "legend": "High Warning Threshold", "color": "orange2", "datapointName": "tempHighWarningThreshold", "isVirtual": false}]}, {"name": "Voltage", "title": "Voltage", "verticalLabel": "volts", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "voltage", "datapointName": "voltage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Volts", "color": "yellow", "datapointName": "voltage", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Transceivers by Highest Temperature", "title": "Top 10 Transceivers by Highest Temperature", "verticalLabel": "\u00b0C", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "currentTemperature", "datapointName": "currentTemperature", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "currentTemperature", "isVirtual": false}]}]}

×DataSource: Microsoft_Azure_CosmosDB (1623)

{"name": "Microsoft_Azure_CosmosDB", "description": "Monitors Azure Cosmos DB requests and request unit usage.", "appliesTo": "hasCategory(\"Azure/CosmosDB\")", "searchKeywords": "cosmosdb,azure", "technicalNotes": "- also known as Document DB.\n- Azure metrics : https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-supported-metrics", "displayedAs": "Azure Cosmos DB", "collectionInterval": "1m", "collectionMethod": "azureinsights", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "MetadataRequests", "description": "Number of metadata requests since the last polling interval. \n\nCosmos DB maintains system metadata collection for each account, that allows you to enumerate collections, databases, etc, and their configurations, free of charge.", "interpretMethod": "json", "interpretExpr": "MetadataRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MongoRequestCharge", "description": "Number of Mongo request units being consumed.", "interpretMethod": "json", "interpretExpr": "MongoRequestCharge.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MongoRequests", "description": "Number of Mongo request made since the last polling interval.", "interpretMethod": "json", "interpretExpr": "MongoRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalRequestUnits", "description": "Total number of request units being consumed.", "interpretMethod": "json", "interpretExpr": "TotalRequestUnits.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalRequests", "description": "Total number of requests made since the last polling interval.", "interpretMethod": "json", "interpretExpr": "TotalRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Request Units", "title": "Request Units", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "MongoRequestCharge", "datapointName": "MongoRequestCharge", "consolidationFn": "max"}, {"name": "TotalRequestUnits", "datapointName": "TotalRequestUnits", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Mongo Request Units", "color": "orange2", "datapointName": "MongoRequestCharge", "isVirtual": false}, {"type": "line", "legend": "Total Request Units", "color": "gray", "datapointName": "TotalRequestUnits", "isVirtual": false}]}, {"name": "Requests", "title": "Requests", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "MetadataRequests", "datapointName": "MetadataRequests", "consolidationFn": "max"}, {"name": "MongoRequests", "datapointName": "MongoRequests", "consolidationFn": "max"}, {"name": "TotalRequests", "datapointName": "TotalRequests", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Metadata Requests", "color": "lime", "datapointName": "MetadataRequests", "isVirtual": false}, {"type": "line", "legend": "Mongo Requests", "color": "orange2", "datapointName": "MongoRequests", "isVirtual": false}, {"type": "line", "legend": "Total Requests", "color": "gray", "datapointName": "TotalRequests", "isVirtual": false}]}]}

×DataSource: Microsoft_Azure_ResourceHealth (902)

{"name": "Microsoft_Azure_ResourceHealth", "description": "Monitors the Azure Resource health state and availability.", "appliesTo": "isAzureService() && azure.resourceHealth.supported == \"true\" && system.azure.databaseName != \"master\" && !hasCategory(\"Azure/Function\") && !hasCategory(\"Azure/AppServicePlan\") && !hasCategory(\"Azure/AppService\")", "searchKeywords": "cloud,vm,health,microsoft,azure", "displayedAs": "Resource Health", "collectionInterval": "5m", "collectionMethod": "azureresourcehealth", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "AvailabilityState", "description": "Gives the availability state for a given virtual machine. The unknown status code indicates that Resource Health hasn't received information about the resource for more than 10 minutes. Although this status isn't a definitive indication of the state of the resource, it's an important data point for troubleshooting. For more information about the unknown status code see: https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview#unknown\n\nStatus Codes:\n0=Available,\n1=Unavailable,\n2=Unknown\n3=Terminated", "config": {"metric": "AvailabilityState"}, "interpretMethod": "none", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "max": "3", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0}, {"name": "AvailabilityStateErrorAlerts", "description": "Gives the availability state for a given virtual machine. The unknown status code indicates that Resource Health hasn't received information about the resource for more than 10 minutes. Although this status isn't a definitive indication of the state of the resource, it's an important data point for troubleshooting. For more information about the unknown status code see: https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview#unknown\n\nStatus Codes:\n0=Available,\n1=Unavailable,\n2=Unknown\n3=Terminated", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(in(1,3,AvailabilityState),AvailabilityState,0)", "type": "gauge", "dataType": 7, "min": "0", "max": "3", "threshold": "> 0 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The Azure Resource ##HOST## is reporting an issue with it's availability state (status code: ##VALUE##), placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago.\n\nStatus Codes:\n0=Available,\n1=Unavailable,\n2=Unknown\n3=Terminated"}, {"name": "ReasonChronicity", "description": "Monitors the chronicity of the availability transition. \n\nStatus Codes:\n0=Persistent,\n1=Transient", "config": {"metric": "ReasonChronicity"}, "interpretMethod": "none", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ReasonType", "description": "A numerical value indicating the reason for the current availability status of the resource.\n\nStatus Codes:\n0=Healthy,\n1=Planned,\n2=Unplanned,\n3=Customer Initiated,\n4=Outage,\n5=Other Reason", "config": {"metric": "ReasonType"}, "interpretMethod": "none", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "max": "5", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Availability State", "title": "Availability State", "verticalLabel": "status code", "min": -1.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AvailabilityState", "datapointName": "AvailabilityState", "consolidationFn": "average"}, {"name": "ReasonType", "datapointName": "ReasonType", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Availability State", "color": "blue", "datapointName": "AvailabilityState", "isVirtual": false}, {"type": "line", "legend": "ReasonType", "color": "green", "datapointName": "ReasonType", "isVirtual": false}]}, {"name": "Chronicity State", "title": "Chronicity State", "verticalLabel": "0=persistent, 1=transient", "min": -1.0, "max": 2.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ReasonChronicity", "datapointName": "ReasonChronicity", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "green", "datapointName": "ReasonChronicity", "isVirtual": false}]}, {"name": "State Reason", "title": "State Reason", "verticalLabel": "status code", "min": -1.0, "max": 6.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ReasonType", "datapointName": "ReasonType", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Reason State", "color": "orange2", "datapointName": "ReasonType", "isVirtual": false}]}]}

×DataSource: Fujitsu_Eternus_Disks (390)

{"name": "Fujitsu_Eternus_Disks", "description": "Monitors Fujitsu Eternus disk status, size and percent busy.", "appliesTo": "hasCategory(\"FujitsuEternus\")", "technicalNotes": "- must provide ssh.user & ssh.pass\n- to auto-associate with Fujitsu Eternus devices, be sure to import the addCategory_FujitsuEternus PropertySource", "displayedAs": "Fujitsu Eternus Disks", "collectionInterval": "4m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.expect.Expect\nimport com.santaba.agent.util.Settings;\n\ndef hostname = hostProps.get(\"system.hostname\");\ndef user = hostProps.get(\"ssh.user\");\ndef pass = hostProps.get(\"ssh.pass\");\ndef timeout = hostProps.get(\"ssh.timeout\") ?: Settings.getGroovyExpectTimeoutInSecond();\n\ntry\n{\n // Generic Prompt Match\n def prompt = '[>#$]';\n\n // Open an Expect session on the host\n def cli = Expect.open(hostname, user, pass, timeout);\n\n // Look for one of a few likely prompt characters\n cli.expect(prompt);\n\n // Update the prompt to have a closer match.\n prompt = cli.before().readLines().last().trim() + prompt;\n\n // Send the command\n cli.send(\"show disks\\n\");\n cli.expect(prompt);\n\n // Store returned text from the CLI\n def results = cli.before();\n\n // Send \"exit\" and close the session\n cli.send(\"exit\\n\");\n cli.close();\n\n // Split the results into an array of lines.\n def lines = results.readLines();\n\n // Loop through each line with index\n lines.eachWithIndex()\n { line, n ->\n\n // Is this line is beyond the second?\n if (n > 1)\n {\n // Yes, split the line on more than one whitespace character.\n def tokens = line.split(/\\s{2,}/);\n\n // Print start of AD line using tokens.\n print \"${tokens[0]}##${tokens[0]}##${tokens[5]}####\";\n\n // Is speed provided?\n if (tokens[4] != \"-\")\n {\n // Yes, add the speed as an ILP\n print \"auto.Speed=${tokens[4]}&\";\n }\n\n // Add the type as an ILP\n println \"auto.Usage=${tokens[5]}&auto.Type=${tokens[3]}\"\n }\n }\n\n return 0;\n}\ncatch (Exception e)\n{\n println e\n return 1\n}"}, "groupMethod": "ilp", "groupExpr": "auto.usage"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.expect.Expect\nimport com.santaba.agent.util.Settings;\n\ndef hostname = hostProps.get(\"system.hostname\");\ndef user = hostProps.get(\"ssh.user\");\ndef pass = hostProps.get(\"ssh.pass\");\ndef timeout = hostProps.get(\"ssh.timeout\") ?: Settings.getGroovyExpectTimeoutInSecond();\n\ntry\n{\n // Generic Prompt Match\n def prompt = '[>#$]';\n\n // Open an Expect session on the host\n def cli = Expect.open(hostname, user, pass, timeout);\n\n // Look for one of a few likely prompt characters\n cli.expect(prompt);\n\n // Update the prompt to have a closer match.\n prompt = cli.before().readLines().last().trim() + prompt;\n\n // Send the first command\n cli.send(\"show disks\\n\");\n cli.expect(prompt);\n\n // Store returned text from the CLI\n def showResults = cli.before();\n\n // Send the second command\n cli.send(\"show performance -type disks\\n\");\n cli.expect(prompt);\n\n // Store returned text from the CLI\n def perfResults = cli.before();\n\n // Send \"exit\" and close the session\n cli.send(\"exit\\n\");\n cli.close();\n\n // Split the results into an array of lines\n def lines = showResults.readLines();\n\n // Create a map to translate status values into numbers\n def statusCodes = [:];\n statusCodes[\"Available\"] = 1;\n statusCodes[\"Spare\"] = 2;\n statusCodes[\"Available(Predictive Failure)\"] = 3;\n\n // Loop through each line with index\n lines.eachWithIndex()\n { line, n ->\n\n // Is this line is beyond the second?\n if (n > 1)\n {\n // Yes, split the line on more than one whitespace character.\n def tokens = line.split(/\\s{2,}/);\n\n // We don't know the size format of this metric, so plan for any and convert to bytes to be safe.\n def size = 0L;\n\n if (tokens[2].contains(\"MB\") || tokens[2].contains(\"M\"))\n {\n size = tokens[2].replaceAll(\"[^\\\\d.]\", \"\").toLong() * 1048576;\n }\n\n if (tokens[2].contains(\"GB\") || tokens[2].contains(\"G\"))\n {\n size = tokens[2].replaceAll(\"[^\\\\d.]\", \"\").toLong() * 1073741824L;\n }\n\n if (tokens[2].contains(\"TB\") || tokens[2].contains(\"T\"))\n {\n size = tokens[2].replaceAll(\"[^\\\\d.]\", \"\").toLong() * 1099511627776L;\n }\n\n // Print the metric (now in bytes)\n println \"${tokens[0]}.Size=${size}\"\n\n // Print the status (translating using our map and using 0 if the value is not in the map)\n println \"${tokens[0]}.Status=${statusCodes[tokens[1]] ?: 0}\"\n }\n }\n\n // Split the results into an array of lines\n lines = perfResults.readLines();\n\n // Loop through each line with index\n lines.eachWithIndex()\n {\n line, n ->\n\n // Is this line is beyond the second?\n if (n > 1)\n {\n // Yes, split the line on more than one whitespace character\n def tokens = line.split(/\\s{2,}/);\n\n // Print the metric extracted from the line\n println \"${tokens[0]}.BusyPercent=${tokens[1]}\"\n }\n }\n\n return 0;\n}\ncatch (Exception e)\n{\n println e\n return 1\n}"}, "datapoints": [{"name": "BusyPercent", "description": "Percent usage of the disk.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.BusyPercent", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Size", "description": "The size of the disk in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Size", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Status", "description": "Current operating status.\n\nStatus Codes:\n0=Unknown\n1=Available,\n2=Spare,\n3=Available Predictive Failure", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Disk Storage Size", "title": "Disk Storage Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "Size", "datapointName": "Size", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Total", "color": "olive", "datapointName": "Size", "isVirtual": false}]}, {"name": "Disk Usage", "title": "Disk Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BusyPercent", "datapointName": "BusyPercent", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "Disk Usage", "color": "orange2", "datapointName": "BusyPercent", "isVirtual": false}]}, {"name": "Operating Status", "title": "Operating Status", "verticalLabel": "status code", "min": -1.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "fuchsia", "datapointName": "Status", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Busiest Disks", "title": "Top 10 Busiest Disks", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "BusyPercent", "datapointName": "BusyPercent", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "BusyPercent", "isVirtual": false}]}, {"name": "Total Size", "title": "Total Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": true, "scale1024": true, "rigid": false, "datapoints": [{"name": "Size", "datapointName": "Size", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "area", "legend": "Aggregate Storage Size", "color": "blue", "datapointName": "Size", "isVirtual": false}]}]}

×DataSource: Citrix_XenApp_ApplicationUsage (586)

{"name": "Citrix_XenApp_ApplicationUsage", "description": "Monitors application usage for XenApp.", "appliesTo": "hasCategory(\"CitrixMonitorServiceV2\") && hasCategory(\"CitrixBrokerActive\")", "searchKeywords": "xen,application,xenapp,citrix", "technicalNotes": "This datasource should only be active for one DDC per farm. Add CitrixBrokerActive to system.categories in order to enable.\n\nUses the Citrix Monitoring Service API. Requires that the collector user have at least Read Only XenApp/Deskop Administrator privileges. The xenapp.user and xenapp.pass properties must also be set.", "displayedAs": "XenApp Application Usage", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport org.apache.http.auth.AuthScope\nimport org.apache.http.auth.NTCredentials\nimport org.apache.http.client.methods.HttpGet\nimport org.apache.http.impl.client.BasicCredentialsProvider\nimport org.apache.http.impl.client.HttpClientBuilder\n\ndef username = hostProps.get(\"xenapp.user\")\n\n// Strip the domain from the username if it's in there.\nif (username.contains(\"\\\\\")) {\n username = username.tokenize(\"\\\\\")[1]\n}\n\ndef password = hostProps.get(\"xenapp.pass\")\ndef hostname = hostProps.get(\"system.hostname\")\n\n// Maps various status codes to meaningful strings\ndef MAP_LIFECYCLE_STATE = [0: \"Active\", 1: \"Deleted\", 2: \"Require Resolution\", 3: \"Stub\"]\n\ndef appDataQuery = \"/Data/Applications\"\n\n// Fetch LogOn Duration info from the API\ndef appDataFeed = getCitrixData(hostname, username, password, appDataQuery)\n\nappDataFeed.entry.each { entry ->\n\n // Get primary attributes\n def wildname = entry.content.properties.Id\n def wildvalue = entry.content.properties.Name\n\n // Catch applications with a null admin folder and set a value so the instance parser doesn't break.\n def admin_folder = entry.content.properties.AdminFolder\n if (admin_folder == null) {\n admin_folder = \"Ungrouped\"\n }\n\n // Get ILP's\n def instance_props = [admin_folder : admin_folder,\n lifecycle_state: MAP_LIFECYCLE_STATE.get(sanitize(entry.content.properties.LifecycleState))]\n\n // Encode our properties\n encoded_instance_props_array = instance_props.collect()\n { property, value ->\n URLEncoder.encode(property.toString()) + \"=\" + URLEncoder.encode(value.toString())\n }\n\n println \"${wildname}##${wildvalue}######${encoded_instance_props_array.join(\"&\")}\"\n}\n\nreturn 0\n\n// Helper method which handles fetching Citrix API data\ndef getCitrixData(String hostname, String username, String password, String query) {\n\n def credentials = new NTCredentials(\"${username}:${password}\")\n\n def enableHTTPS = hostProps.get(\"Citrix.VAD.HTTPS\") ?: false //optional, set property to true for https mode, defaults to http connection\n def enableSecureHostname = hostProps.get(\"Citrix.VAD.SecureHostname\") ?: hostname //optional, set property to the hostname used in the certificate for https mode, defaults to hostname\n\n def uri = \"http://${hostname}/Citrix/Monitor/Odata/v2${URLEncoder.encode(query)}\"\n\n if (enableHTTPS.toBoolean()) { uri = \"https://${enableSecureHostname}/Citrix/Monitor/Odata/v2${URLEncoder.encode(query)}\" }\n\n def credentialProvider = new BasicCredentialsProvider()\n credentialProvider.setCredentials(AuthScope.ANY, credentials)\n\n def client = HttpClientBuilder.create().setDefaultCredentialsProvider(credentialProvider).build()\n\n def httpResponse = client.execute(new HttpGet(uri))\n\n if (httpResponse.getStatusLine().getStatusCode() != 200) {\n throw new Exception(httpResponse.getStatusLine().toString())\n }\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()))\n\n String inputLine\n StringBuffer response = new StringBuffer()\n\n while ((inputLine = reader.readLine()) != null) {\n response.append(inputLine)\n }\n\n reader.close()\n client.close()\n\n raw_xml = response.toString()\n //println raw_xml\n\n def data = new XmlSlurper().parseText(raw_xml)\n\n return data\n}\n\n// Helper method which handles converting passed value to Integer\ndef sanitize(value) {\n if (value != null) {\n try {\n value = value.toInteger()\n }\n catch (Exception) {\n value = null\n }\n }\n return value\n}"}, "groupMethod": "ilp", "groupExpr": "auto.admin_folder"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport org.apache.http.auth.AuthScope\nimport org.apache.http.auth.NTCredentials\nimport org.apache.http.client.methods.HttpGet\nimport org.apache.http.impl.client.BasicCredentialsProvider\nimport org.apache.http.impl.client.HttpClientBuilder\n\ndef username = hostProps.get(\"xenapp.user\")\n\n// Strip the domain from the username if it's in there.\nif (username.contains(\"\\\\\")) {\n username = username.tokenize(\"\\\\\")[1]\n}\n\ndef password = hostProps.get(\"xenapp.pass\")\ndef hostname = hostProps.get(\"system.hostname\")\n\ndef now = new Date()\ndef yesterday = (now - 1).format(\"yyyy-MM-dd'T'HH:mm:ss\")\ndef weekAgo = (now - 7).format(\"yyyy-MM-dd'T'HH:mm:ss\")\ndef monthAgo = (now - 30).format(\"yyyy-MM-dd'T'HH:mm:ss\")\n\n// Maps various status codes to meaningful strings\nMAP_CONNECTION_STATE = [0: \"Unknown\",\n 1: \"Connected\",\n 2: \"Disconnected\",\n 3: \"Terminated\",\n 4: \"PreparingSession\",\n 5: \"Active\",\n 6: \"Reconnecting\",\n 7: \"NonBrokeredSession\",\n 8: \"Other\",\n 9: \"Pending\"]\n\n// Get the applications\ndef appDataFeed = getCitrixData(hostname, username, password, \"/Data/Applications\")\n\n// Count the applications so we know how many records to ask for when getting ApplicationUsage data\ndef application_count = appDataFeed.entry.size()\n\n\n// Get usage trends for the last 24 hours\ndef appUsageRecords24hrQuery = \"/Methods/GetApplicationUsage?startDate=datetime'${yesterday}'&intervalLength=1440&offset=0&count=${application_count}\"\ndef appUsageRecords24hr = getCitrixData(hostname, username, password, appUsageRecords24hrQuery)\n\n\nif (appUsageRecords24hr != 404) {\n appUsageRecords24hr.entry.each { entry ->\n writeApplicationTrends(entry, \"24Hours\")\n }\n\n}\n\n\n// Get usage trends for the last 7 days\ndef appUsageRecords7DayQuery = \"/Methods/GetApplicationUsage?startDate=datetime'${weekAgo}'&intervalLength=10080&offset=0&count=${application_count}\"\ndef appUsageRecords7Day = getCitrixData(hostname, username, password, appUsageRecords7DayQuery)\n\nif (appUsageRecords7Day != 404) {\n appUsageRecords7Day.entry.each { entry ->\n writeApplicationTrends(entry, \"7Days\")\n }\n\n}\n\n\n// Get usage trends for the last 30 days\ndef appUsageRecords30DayQuery = \"/Methods/GetApplicationUsage?startDate=datetime'${monthAgo}'&intervalLength=43200&offset=0&count=${application_count}\"\ndef appUsageRecords30Day = getCitrixData(hostname, username, password, appUsageRecords30DayQuery)\n\nif (appUsageRecords30Day != 404) {\n appUsageRecords30Day.entry.each { entry ->\n writeApplicationTrends(entry, \"30Days\")\n }\n\n}\n\n\n// Get all active sessions and break them down by date filter.\ndef all_app_instances_query = \"/Data/ApplicationInstances?\\$expand=Session&\\$filter=(EndDate eq null)\"\ndef app_instances_feed = getCitrixData(hostname, username, password, all_app_instances_query)\n\ndef appSessions = [:] // appId:[session,...]\n\napp_instances_feed.entry.each { entry ->\n def appInstance = entry.content.properties\n def appId = appInstance.ApplicationId.toString()\n\n def appSessionList = appSessions.get(appId, [])\n def session_link = entry.link.findAll { it.@title == \"Session\" }\n def session = session_link.inline.entry.content.properties\n\n appSessionList << session\n appSessions[appId] = appSessionList\n}\n\nappSessions.each { appId, sessions ->\n //println \"${appId} - ${sessions.size()}\"\n MAP_CONNECTION_STATE.each { connectionState, stateLabel ->\n match = sessions.findAll { session ->\n session.ConnectionState == connectionState\n }\n println \"${appId}.Current${stateLabel}Instances=${match.size()}\"\n }\n println \"${appId}.CurrentTotalInstances=${sessions.size()}\"\n}\n\n// Report all of the remaining apps (that are not running) as 0.\nappDataFeed.entry.each { entry ->\n def app = entry.content.properties\n def appId = app.Id.toString()\n\n if (!appSessions.containsKey(appId)) {\n MAP_CONNECTION_STATE.each { connectionState, stateLabel ->\n println \"${appId}.Current${stateLabel}Instances=0\"\n }\n println \"${appId}.CurrentTotalInstances=0\"\n }\n}\n\nreturn 0\n\n// Helper method which handles writing trends data for each application\ndef writeApplicationTrends(record, interval_string) {\n\n id = record.content.properties.ApplicationId\n name = record.content.properties.ApplicationName\n\n peak_concurrent_application_instances = record.content.properties.PeakConcurrentApplicationInstances\n total_application_instances = record.content.properties.TotalApplicationInstances\n total_application_launches = record.content.properties.TotalApplicationLaunches\n application_usage_duration_in_hours = record.content.properties.ApplicationUsageDurationInHours\n\n distinct_users = record.content.properties.DistinctUsers\n // If null then distinct users is 0\n if (distinct_users == \"\") {\n distinct_users = 0\n }\n\n println \"${id}.PeakConcurrentApplicationInstances${interval_string}=${peak_concurrent_application_instances}\"\n println \"${id}.TotalApplicationInstances${interval_string}=${total_application_instances}\"\n println \"${id}.TotalApplicationLaunches${interval_string}=${total_application_launches}\"\n println \"${id}.ApplicationUsageDurationInHours${interval_string}=${application_usage_duration_in_hours}\"\n println \"${id}.DistinctUsers${interval_string}=${distinct_users}\"\n //println \"${id}.ApplicationName=${record.content.properties.ApplicationName}\"\n}\n\n// Helper method which handles fetching Citrix API data\ndef getCitrixData(String hostname, String username, String password, String query) {\n\n def credentials = new NTCredentials(\"${username}:${password}\")\n\n def enableHTTPS = hostProps.get(\"Citrix.VAD.HTTPS\") ?: false //optional, set property to true for https mode, defaults to http connection\n def enableSecureHostname = hostProps.get(\"Citrix.VAD.SecureHostname\") ?: hostname //optional, set property to the hostname used in the certificate for https mode, defaults to hostname\n\n def uri = \"http://${hostname}/Citrix/Monitor/Odata/v2${URLEncoder.encode(query)}\"\n\n if (enableHTTPS.toBoolean()) { uri = \"https://${enableSecureHostname}/Citrix/Monitor/Odata/v2${URLEncoder.encode(query)}\" }\n\n def credentialProvider = new BasicCredentialsProvider()\n credentialProvider.setCredentials(AuthScope.ANY, credentials)\n\n def client = HttpClientBuilder.create().setDefaultCredentialsProvider(credentialProvider).build()\n\n def httpResponse = client.execute(new HttpGet(uri))\n\n if (httpResponse.getStatusLine().getStatusCode() == 404) {\n return 404\n }\n\n if (httpResponse.getStatusLine().getStatusCode() != 200) {\n throw new Exception(httpResponse.getStatusLine().toString())\n }\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()))\n\n String inputLine\n StringBuffer response = new StringBuffer()\n while ((inputLine = reader.readLine()) != null) {\n response.append(inputLine)\n }\n\n reader.close()\n client.close()\n\n raw_xml = response.toString()\n //println raw_xml\n\n def data = new XmlSlurper().parseText(raw_xml)\n\n return data\n}"}, "datapoints": [{"name": "ApplicationUsageDurationInHours24Hours", "description": "The usage duration of the application in hours over the last 24 hour interval.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ApplicationUsageDurationInHours24Hours", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ApplicationUsageDurationInHours30Days", "description": "The usage duration of the application in hours over the last 30 days.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ApplicationUsageDurationInHours30Days", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ApplicationUsageDurationInHours7Days", "description": "The usage duration of the application in hours over the last 7 days.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ApplicationUsageDurationInHours7Days", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentActiveInstances", "description": "The number of instances where the session is active.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentActiveInstances", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentConnectedInstances", "description": "The number of instances where the session is actively connected to the desktop.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentConnectedInstances", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentDisconnectedInstances", "description": "The number of instances where the session is disconnected from desktop, but session still exists.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentDisconnectedInstances", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentNonBrokeredSessionInstances", "description": "The number of instances where session is non-brokered", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentNonBrokeredSessionInstances", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentOtherInstances", "description": "The number of application instances where connection state is reported as other.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentOtherInstances", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentPendingInstances", "description": "The number of instances where the connection state is pending.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentPendingInstances", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentPreparingSessionInstances", "description": "The number of application instances where the session is in the preparing state", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentPreparingSessionInstances", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentReconnectingInstances", "description": "The number of application instances in which the user is reconnecting to the session", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentReconnectingInstances", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentTerminatedInstances", "description": "The number of application instances where the session has been terminated", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentTerminatedInstances", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentTotalInstances", "description": "The total instances for this application.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentTotalInstances", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentUnknownInstances", "description": "The number of instances where the session state is unknown.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentUnknownInstances", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DistinctUsers24Hours", "description": "The number of distinct users using the application over the last 24 hours.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.DistinctUsers24Hours", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DistinctUsers30Days", "description": "The number of distinct users using the application over the last 30 days.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.DistinctUsers30Days", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DistinctUsers7Days", "description": "The number of distinct users using the application over the last 7 days.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.DistinctUsers7Days", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PeakConcurrentApplicationInstances24Hours", "description": "The highest number of concurrent instances of this application over the last 24 hours.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.PeakConcurrentApplicationInstances24Hours", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PeakConcurrentApplicationInstances30Days", "description": "The highest number of concurrent instances of this application over the last 30 days.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.PeakConcurrentApplicationInstances30Days", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PeakConcurrentApplicationInstances7Days", "description": "The highest number of concurrent instances of this application over the last 7 days.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.PeakConcurrentApplicationInstances7Days", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalApplicationInstances24Hours", "description": "The total number of instances over the last 24 hours.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.TotalApplicationInstances24Hours", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalApplicationInstances30Days", "description": "The total number of instances over the last 30 days.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.TotalApplicationInstances30Days", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalApplicationInstances7Days", "description": "The total number of instances over the last 7 days.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.TotalApplicationInstances7Days", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalApplicationLaunches24Hours", "description": "The total number of times this application was launched over the last 24 hours.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.TotalApplicationLaunches24Hours", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalApplicationLaunches30Days", "description": "The total number of times this application was launched over the last 30 days.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.TotalApplicationLaunches30Days", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalApplicationLaunches7Days", "description": "The total number of times this application was launched over the last 7 days.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.TotalApplicationLaunches7Days", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Application Instances", "title": "Application Instances", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CurrentActiveInstances", "datapointName": "CurrentActiveInstances", "consolidationFn": "average"}, {"name": "CurrentConnectedInstances", "datapointName": "CurrentConnectedInstances", "consolidationFn": "average"}, {"name": "CurrentDisconnectedInstances", "datapointName": "CurrentDisconnectedInstances", "consolidationFn": "average"}, {"name": "CurrentNonBrokeredSessionInstances", "datapointName": "CurrentNonBrokeredSessionInstances", "consolidationFn": "average"}, {"name": "CurrentOtherInstances", "datapointName": "CurrentOtherInstances", "consolidationFn": "average"}, {"name": "CurrentPendingInstances", "datapointName": "CurrentPendingInstances", "consolidationFn": "average"}, {"name": "CurrentPreparingSessionInstances", "datapointName": "CurrentPreparingSessionInstances", "consolidationFn": "average"}, {"name": "CurrentReconnectingInstances", "datapointName": "CurrentReconnectingInstances", "consolidationFn": "average"}, {"name": "CurrentTerminatedInstances", "datapointName": "CurrentTerminatedInstances", "consolidationFn": "average"}, {"name": "CurrentUnknownInstances", "datapointName": "CurrentUnknownInstances", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Active", "color": "olive", "datapointName": "CurrentActiveInstances", "isVirtual": false}, {"type": "stack", "legend": "Connected", "color": "fuchsia", "datapointName": "CurrentConnectedInstances", "isVirtual": false}, {"type": "stack", "legend": "Disconnected", "color": "red", "datapointName": "CurrentDisconnectedInstances", "isVirtual": false}, {"type": "stack", "legend": "Non-Brokered Session", "color": "gray", "datapointName": "CurrentNonBrokeredSessionInstances", "isVirtual": false}, {"type": "stack", "legend": "Other", "color": "black", "datapointName": "CurrentOtherInstances", "isVirtual": false}, {"type": "stack", "legend": "Pending", "color": "teal", "datapointName": "CurrentPendingInstances", "isVirtual": false}, {"type": "line", "legend": "CurrentPreparingSessionInstances", "color": "silver", "datapointName": "CurrentPreparingSessionInstances", "isVirtual": false}, {"type": "stack", "legend": "Reconnecting", "color": "aqua", "datapointName": "CurrentReconnectingInstances", "isVirtual": false}, {"type": "stack", "legend": "Terminated", "color": "yellow", "datapointName": "CurrentTerminatedInstances", "isVirtual": false}, {"type": "stack", "legend": "Unknown", "color": "orange2", "datapointName": "CurrentUnknownInstances", "isVirtual": false}]}, {"name": "Application Usage Duration", "title": "Application Usage Duration", "verticalLabel": "hours", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ApplicationUsageDurationInHours24Hours", "datapointName": "ApplicationUsageDurationInHours24Hours", "consolidationFn": "average"}, {"name": "ApplicationUsageDurationInHours30Days", "datapointName": "ApplicationUsageDurationInHours30Days", "consolidationFn": "average"}, {"name": "ApplicationUsageDurationInHours7Days", "datapointName": "ApplicationUsageDurationInHours7Days", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Application Usage Duration 24 Hours", "color": "yellow", "datapointName": "ApplicationUsageDurationInHours24Hours", "isVirtual": false}, {"type": "line", "legend": "Application Usage Duration 30 Days", "color": "red2", "datapointName": "ApplicationUsageDurationInHours30Days", "isVirtual": false}, {"type": "line", "legend": "Application Usage Duration 7 Days", "color": "orange", "datapointName": "ApplicationUsageDurationInHours7Days", "isVirtual": false}]}, {"name": "Peak Concurrent Application Instances", "title": "Peak Concurrent Application Instances", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PeakConcurrentApplicationInstances24Hours", "datapointName": "PeakConcurrentApplicationInstances24Hours", "consolidationFn": "max"}, {"name": "PeakConcurrentApplicationInstances30Days", "datapointName": "PeakConcurrentApplicationInstances30Days", "consolidationFn": "max"}, {"name": "PeakConcurrentApplicationInstances7Days", "datapointName": "PeakConcurrentApplicationInstances7Days", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Peak Concurrent Application Instances 24 Hours", "color": "orange", "datapointName": "PeakConcurrentApplicationInstances24Hours", "isVirtual": false}, {"type": "line", "legend": "Peak Concurrent Application Instances 30 Days", "color": "yellow", "datapointName": "PeakConcurrentApplicationInstances30Days", "isVirtual": false}, {"type": "line", "legend": "Peak Concurrent Application Instances 7 Days", "color": "orange2", "datapointName": "PeakConcurrentApplicationInstances7Days", "isVirtual": false}]}, {"name": "Total Application Instances", "title": "Total Application Instances", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "TotalApplicationInstances24Hours", "datapointName": "TotalApplicationInstances24Hours", "consolidationFn": "max"}, {"name": "TotalApplicationInstances30Days", "datapointName": "TotalApplicationInstances30Days", "consolidationFn": "max"}, {"name": "TotalApplicationInstances7Days", "datapointName": "TotalApplicationInstances7Days", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Total Application Instances 24 Hours", "color": "green", "datapointName": "TotalApplicationInstances24Hours", "isVirtual": false}, {"type": "line", "legend": "Total Application Instances 30 Days", "color": "lime", "datapointName": "TotalApplicationInstances30Days", "isVirtual": false}, {"type": "line", "legend": "Total Application Instances 7 Days", "color": "olive", "datapointName": "TotalApplicationInstances7Days", "isVirtual": false}]}, {"name": "Total Application Launches", "title": "Total Application Launches", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "TotalApplicationLaunches24Hours", "datapointName": "TotalApplicationLaunches24Hours", "consolidationFn": "max"}, {"name": "TotalApplicationLaunches30Days", "datapointName": "TotalApplicationLaunches30Days", "consolidationFn": "max"}, {"name": "TotalApplicationLaunches7Days", "datapointName": "TotalApplicationLaunches7Days", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Total Application Launches 24 Hours", "color": "silver", "datapointName": "TotalApplicationLaunches24Hours", "isVirtual": false}, {"type": "line", "legend": "Total Application Launches 30 Days", "color": "aqua", "datapointName": "TotalApplicationLaunches30Days", "isVirtual": false}, {"type": "line", "legend": "Total Application Launches 7 Days", "color": "navy", "datapointName": "TotalApplicationLaunches7Days", "isVirtual": false}]}], "overviewGraphs": [{"name": "Application Instances", "title": "Application Instances", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "CurrentTotalInstances", "datapointName": "CurrentTotalInstances", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "CurrentTotalInstances", "isVirtual": false}]}, {"name": "Top 10 Applications by Distinct Users (24 hours)", "title": "Top 10 Applications by Distinct Users (24 hours)", "verticalLabel": "count", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "DistinctUsers24Hours", "datapointName": "DistinctUsers24Hours", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "DistinctUsers24Hours", "isVirtual": false}]}, {"name": "Top 10 Applications by Distinct Users (30 days)", "title": "Top 10 Applications by Distinct Users (30 days)", "verticalLabel": "count", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "DistinctUsers30Days", "datapointName": "DistinctUsers30Days", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "DistinctUsers30Days", "isVirtual": false}]}, {"name": "Top 10 Applications by Distinct Users (7 days)", "title": "Top 10 Applications by Distinct Users (7 days)", "verticalLabel": "count", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "DistinctUsers7Days", "datapointName": "DistinctUsers7Days", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "DistinctUsers7Days", "isVirtual": false}]}, {"name": "Top 10 Applications by Peak Concurrent Instances (24 hours)", "title": "Top 10 Applications by Peak Concurrent Instances (24 hours)", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "PeakConcurrentApplicationInstances24Hours", "datapointName": "PeakConcurrentApplicationInstances24Hours", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "PeakConcurrentApplicationInstances24Hours", "isVirtual": false}]}, {"name": "Top 10 Applications by Peak Concurrent Instances (30 days)", "title": "Top 10 Applications by Peak Concurrent Instances (30 days)", "verticalLabel": "count", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "PeakConcurrentApplicationInstances30Days", "datapointName": "PeakConcurrentApplicationInstances30Days", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "PeakConcurrentApplicationInstances30Days", "isVirtual": false}]}, {"name": "Top 10 Applications by Peak Concurrent Instances (7 days)", "title": "Top 10 Applications by Peak Concurrent Instances (7 days)", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "PeakConcurrentApplicationInstances7Days", "datapointName": "PeakConcurrentApplicationInstances7Days", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "PeakConcurrentApplicationInstances7Days", "isVirtual": false}]}, {"name": "Top 10 Applications by Usage Duration (24 hours)", "title": "Top 10 Applications by Usage Duration (24 hours)", "verticalLabel": "hours", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ApplicationUsageDurationInHours24Hours", "datapointName": "ApplicationUsageDurationInHours24Hours", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "ApplicationUsageDurationInHours24Hours", "isVirtual": false}]}, {"name": "Top 10 Applications by Usage Duration (30 days)", "title": "Top 10 Applications by Usage Duration (30 days)", "verticalLabel": "hours", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ApplicationUsageDurationInHours30Days", "datapointName": "ApplicationUsageDurationInHours30Days", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "ApplicationUsageDurationInHours30Days", "isVirtual": false}]}, {"name": "Top 10 Applications by Usage Duration (7 days)", "title": "Top 10 Applications by Usage Duration (7 days)", "verticalLabel": "hours", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ApplicationUsageDurationInHours7Days", "datapointName": "ApplicationUsageDurationInHours7Days", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "ApplicationUsageDurationInHours7Days", "isVirtual": false}]}]}

×DataSource: EMC_VPLEX_VirtualVolumePerformance (1743)

{"name": "EMC_VPLEX_VirtualVolumePerformance", "description": "Monitors per director virtual volume performance metrics such as IOPS, R/W throughput and R/W latency.", "appliesTo": "hasCategory(\"EMC_VPLEX\")", "technicalNotes": "- metrics pulled via SNMP.", "displayedAs": "VPLEX Virtual Volume Performance", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\nhost = hostProps.get('system.hostname');\n\n// gather all properties necessary.\nprops = hostProps.toProperties()\n\ntimeout = 10000 // 10 sec timeout\n\ntry\n{\n // Virtual Volume Director\n def vvDirector_walkAsmap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1139.21.2.2.1.1.3\", props, timeout);\n\n // Virtual Volume Performance Metrics\n def vvName_walkAsmap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1139.21.2.2.8.1.1\", props, timeout);\n\n vvName_walkAsmap.each\n { oid, vvName ->\n\n tokenized_oid = oid.toString().tokenize('.')\n\n director_oid = \"${tokenized_oid[0]}.${tokenized_oid[1]}.${tokenized_oid[2]}.${tokenized_oid[3]}\"\n\n director = vvDirector_walkAsmap[director_oid]\n\n wildvalue = \"${director}_${vvName}\"\n\n println \"${wildvalue}##${vvName} - ${director}######\" +\n \"auto.vplex.virtual_volume.name=${vvName}&\" +\n \"auto.vplex.virtual_volume.director=${director}\"\n }\n\n return 0;\n\n}\ncatch (Exception e)\n{\n println e;\n return 1;\n}\n"}, "groupMethod": "regex", "groupExpr": "dynamicGroup=\"(.*)\\s-\\s.*\""}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\nhost = hostProps.get('system.hostname');\n\n// gather all properties necessary.\nprops = hostProps.toProperties()\n\ntimeout = 10000 // 10 sec timeout\n\ntry\n{\n // Virtual Volume Director\n def vvDirector_walkAsmap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1139.21.2.2.1.1.3\", props, timeout);\n\n // Virtual Volume Performance Metrics\n def vvName_walkAsmap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1139.21.2.2.8.1.1\", props, timeout);\n def vvOPS_walkAsmap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1139.21.2.2.8.1.3\", props, timeout);\n def vvReadBytes_walkAsmap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1139.21.2.2.8.1.4\", props, timeout);\n def vvWriteBytes_walkAsmap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1139.21.2.2.8.1.5\", props, timeout);\n def vvReadLatency_walkAsmap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1139.21.2.2.8.1.6\", props, timeout);\n def vvWriteLatency_walkAsmap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.1139.21.2.2.8.1.7\", props, timeout);\n\n\n vvName_walkAsmap.each\n { oid, vvName ->\n\n tokenized_oid = oid.toString().tokenize('.')\n\n director_oid = \"${tokenized_oid[0]}.${tokenized_oid[1]}.${tokenized_oid[2]}.${tokenized_oid[3]}\"\n\n director = vvDirector_walkAsmap[director_oid]\n\n wildvalue = \"${director}_${vvName}\"\n\n println \"${wildvalue}.ops=\" + vvOPS_walkAsmap[oid]\n println \"${wildvalue}.readBytes=\" + vvReadBytes_walkAsmap[oid]\n println \"${wildvalue}.writeBytes=\" + vvWriteBytes_walkAsmap[oid]\n println \"${wildvalue}.readLatency=\" + vvReadLatency_walkAsmap[oid]\n println \"${wildvalue}.writeLatency=\" + vvWriteLatency_walkAsmap[oid]\n }\n\n return 0;\n\n}\ncatch (Exception e)\n{\n println e;\n return 1;\n}"}, "datapoints": [{"name": "avgLatencyMilliseconds", "description": "Average read/write latency, in milliseconds.", "interpretMethod": "expression", "interpretExpr": "(((readLatency + writeLatency) / 2) / 1000)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ops", "description": "Number of read/write operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ops", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "readBytes", "description": "Amount of data read in bytes/sec.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.readBytes", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "readLatency", "description": "Average read latency in microseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.readLatency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "readLatencyMilliseconds", "description": "Average read latency in milliseconds.", "interpretMethod": "expression", "interpretExpr": "readLatency / 1000", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "writeBytes", "description": "Amount of data written in bytes/sec.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.writeBytes", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "writeLatency", "description": "Average write latency in microseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.writeLatency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "writeLatencyMilliseconds", "description": "Average write latency in milliseconds.", "interpretMethod": "expression", "interpretExpr": "writeLatency / 1000", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "IOPS", "title": "IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ops", "datapointName": "ops", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Operations", "color": "navy", "datapointName": "ops", "isVirtual": false}]}, {"name": "Latency", "title": "Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "avgLatencyMilliseconds", "datapointName": "avgLatencyMilliseconds", "consolidationFn": "average"}, {"name": "readLatencyMilliseconds", "datapointName": "readLatencyMilliseconds", "consolidationFn": "average"}, {"name": "writeLatencyMilliseconds", "datapointName": "writeLatencyMilliseconds", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Average", "color": "orange2", "datapointName": "avgLatencyMilliseconds", "isVirtual": false}, {"type": "line", "legend": "Read", "color": "navy", "datapointName": "readLatencyMilliseconds", "isVirtual": false}, {"type": "line", "legend": "Write", "color": "green", "datapointName": "writeLatencyMilliseconds", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "readBytes", "datapointName": "readBytes", "consolidationFn": "average"}, {"name": "writeBytes", "datapointName": "writeBytes", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "aqua", "datapointName": "readBytes", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "lime", "datapointName": "writeBytes", "isVirtual": false}]}], "overviewGraphs": [{"name": "Average R/W Latency", "title": "Average R/W Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "avgLatencyMilliseconds", "datapointName": "avgLatencyMilliseconds", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "avgLatencyMilliseconds", "isVirtual": false}]}, {"name": "IOPS Overview", "title": "IOPS Overview", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ops", "datapointName": "ops", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "ops", "isVirtual": false}]}, {"name": "Total Throughput Overview", "title": "Total Throughput Overview", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "readBytes", "datapointName": "readBytes", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "writeBytes", "datapointName": "writeBytes", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "total_throughput", "expr": "readBytes + writeBytes"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "total_throughput", "isVirtual": true}]}]}

×DataSource: EMC_VPLEX_VirtualVolumes (1742)

{"name": "EMC_VPLEX_VirtualVolumes", "description": "Monitors the VPLEX virtual volume health, operating, service state as well as storage utilization.", "appliesTo": "hasCategory(\"EMC_VPLEX\")", "searchKeywords": "virtual,vplex,volumes,emc,storage", "displayedAs": "VPLEX Virtual Volumes", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.http.*\nimport groovy.json.JsonSlurper;\n\nhostname = hostProps.get(\"system.hostname\");\nusername = hostProps.get(\"emc.vplex.user\");\npass = hostProps.get(\"emc.vplex.pass\");\n\ncollector_platform = hostProps.get(\"system.collectorplatform\")\nfilename = \"${hostname}-VPLEX-jSESSIONID.txt\" // name of our file containing the jSESSION.\n\ntry\n{\n getAPIOutput('/vplex/clusters/*/virtual-volumes/*').response.context.each\n { output ->\n\n cluster = output.parent.toString().tokenize('/')[1]\n\n Map attributes_map = [:]\n\n output.attributes.each { it -> attributes_map.put(it[\"name\"], it[\"value\"]) }\n\n wildvalue = \"${cluster}_${attributes_map.'name'}\"\n\n println \"${wildvalue}##${attributes_map.'name'} - ${cluster}######\" +\n \"auto.vplex.virtual_volume.name=${attributes_map.'name'}&\" +\n \"auto.vplex.virtual_volume.block_size=${attributes_map.'block-size'}&\" +\n \"auto.vplex.virtual_volume.expandable=${attributes_map.'expandable'}&\" +\n \"auto.vplex.virtual_volume.locality=${attributes_map.'locality'}&\" +\n \"auto.vplex.virtual_volume.supporting_device=${attributes_map.'supporting-device'}&\" +\n \"auto.vplex.virtual_volume.storage_tier=${attributes_map.'storage-tier'}&\" +\n \"auto.vplex.cluster=${cluster}\"\n }\n\n return 0;\n\n}\ncatch (Exception e)\n{\n println e;\n return 1;\n}\n\n/**\n * Helper method to handle the HTTP Client, API authentication and returns jSON output.\n * @param api_endpoint\n * @return\n */\ndef getAPIOutput(String api_endpoint)\n{\n // instantiate an http client object for the target system\n httpClient = HTTP.open(hostname, 443);\n\n // specify the url to which we want to post\n url = \"https://\" + hostname + api_endpoint\n\n request_headers =\n [\n \"Content-Type\": \"application/json\",\n \"Username\" : \"${username}\",\n \"Password\" : \"${pass}\",\n \"Cookie\" : \"JSESSIONID=${getSessionID()}\"\n ];\n\n httpClient.get(url, request_headers)\n body = httpClient.getResponseBody();\n\n // Did we get a session ID ?\n if (httpClient.getHeader(\"Set-Cookie\"))\n {\n // Yes, that means our saved session ID is invalid and we must update it.\n // Identify our new session ID.\n new_sessionID = (httpClient.getHeader(\"Set-Cookie\").toString() =~ \"JSESSIONID=(.*);\\\\sPath.*\")\n\n // update session ID file.\n updateSessionID(new_sessionID[0][1].toString())\n }\n\n def json_output = new JsonSlurper().parseText(body)\n\n // did we get a successful execution ?\n if (httpClient.getStatusCode() == 200)\n {\n // yes\n return json_output\n }\n}\n\n/**\n * Retrieves the saved jSESSION ID from our file.\n * @return jSESSION ID\n */\ndef getSessionID()\n{\n // do we have a file to read from?\n if (getInputFile().exists())\n {\n // Yes\n // read the saved sesssion ID from our file.\n sessionID = getInputFile().readLines()[0]\n }\n else\n {\n // No\n // Create the file and pass back empty sessionID.\n getInputFile().createNewFile()\n sessionID = ''\n }\n\n // return the ID.\n return sessionID\n}\n\n/**\n * Updates the saved jSESSION ID with new one.\n * @param sessionID\n * @return\n */\ndef updateSessionID(String sessionID)\n{\n // delete existing session ID\n getInputFile().delete()\n\n // write new session ID.\n getInputFile().write(sessionID)\n}\n\n/**\n * Gets the input file.\n * @return input file\n */\ndef getInputFile()\n{\n // Check collector platform because it changes the file path.\n if (collector_platform == 'windows')\n {\n // Windows\n inputFile = new File('..\\\\\\\\logs\\\\\\\\' + filename)\n }\n else\n {\n // Linux\n inputFile = new File(\"../logs/\" + filename)\n }\n\n return inputFile\n}"}, "groupMethod": "ilp", "groupExpr": "auto.vplex.cluster"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.http.*\nimport groovy.json.JsonSlurper;\n\nhostname = hostProps.get(\"system.hostname\");\nusername = hostProps.get(\"emc.vplex.user\");\npass = hostProps.get(\"emc.vplex.pass\");\n\ncollector_platform = hostProps.get(\"system.collectorplatform\")\nfilename = \"${hostname}-VPLEX-jSESSIONID.txt\" // name of our file containing the jSESSION.\n\n// gather all properties necessary.\nprops = hostProps.toProperties()\ntimeout = 10000 // timeout in milliseconds.\n\ntry\n{\n Map healthStatus_Map =\n [\n 'unknown':'0',\n 'ok':'1',\n 'degraded':'2',\n 'minor-failure':'3',\n 'major-failure':'4',\n 'critical-failure':'5',\n ]\n\n Map operatingStatus_Map =\n [\n 'unknown':'0',\n 'ok':'1',\n 'degraded':'2',\n 'transitioning':'3',\n 'isolated':'4',\n 'not-running':'5',\n ]\n\n getAPIOutput('/vplex/clusters/*/virtual-volumes/*').response.context.each\n { output ->\n\n cluster = output.parent.toString().tokenize('/')[1]\n\n Map attributes_map = [:]\n\n output.attributes.each { it -> attributes_map.put(it[\"name\"], it[\"value\"]) }\n\n wildvalue = \"${cluster}_${attributes_map.'name'}\"\n\n println \"${wildvalue}.volumeCapacity=\" + attributes_map.'capacity'.toString().replaceAll(\"B\", \"\").toLong()\n println \"${wildvalue}.expandableCapacity=\" + attributes_map.'expandable-capacity'.toString().replaceAll(\"B\", \"\").toLong()\n println \"${wildvalue}.healthState=\" + healthStatus_Map[attributes_map.'health-state'.toString()]\n println \"${wildvalue}.operationalStatus=\" + operatingStatus_Map[attributes_map.'operational-status'.toString()]\n println \"${wildvalue}.serviceStatus=\" + ((attributes_map.'service-status' == 'ok') ? '1' : '0')\n }\n\n return 0;\n}\ncatch (Exception e)\n{\n println e;\n return 1;\n}\n\n/**\n * Helper method to handle the HTTP Client, API authentication and returns jSON output.\n * @param api_endpoint\n * @return\n */\ndef getAPIOutput(String api_endpoint)\n{\n // instantiate an http client object for the target system\n httpClient = HTTP.open(hostname, 443);\n\n // specify the url to which we want to post\n url = \"https://\" + hostname + api_endpoint\n\n request_headers =\n [\n \"Content-Type\": \"application/json\",\n \"Username\" : \"${username}\",\n \"Password\" : \"${pass}\",\n \"Cookie\" : \"JSESSIONID=${getSessionID()}\"\n ];\n\n httpClient.get(url, request_headers)\n body = httpClient.getResponseBody();\n\n // Did we get a session ID ?\n if (httpClient.getHeader(\"Set-Cookie\"))\n {\n // Yes, that means our saved session ID is invalid and we must update it.\n // Identify our new session ID.\n new_sessionID = (httpClient.getHeader(\"Set-Cookie\").toString() =~ \"JSESSIONID=(.*);\\\\sPath.*\")\n\n // update session ID file.\n updateSessionID(new_sessionID[0][1].toString())\n }\n\n def json_output = new JsonSlurper().parseText(body)\n\n // did we get a successful execution ?\n if (httpClient.getStatusCode() == 200)\n {\n // yes\n return json_output\n }\n}\n\n/**\n * Retrieves the saved jSESSION ID from our file.\n * @return jSESSION ID\n */\ndef getSessionID()\n{\n // do we have a file to read from?\n if (getInputFile().exists())\n {\n // Yes\n // read the saved sesssion ID from our file.\n sessionID = getInputFile().readLines()[0]\n }\n else\n {\n // No\n // Create the file and pass back empty sessionID.\n getInputFile().createNewFile()\n sessionID = ''\n }\n\n // return the ID.\n return sessionID\n}\n\n/**\n * Updates the saved jSESSION ID with new one.\n * @param sessionID\n * @return\n */\ndef updateSessionID(String sessionID)\n{\n // delete existing session ID\n getInputFile().delete()\n\n // write new session ID.\n getInputFile().write(sessionID)\n}\n\n/**\n * Gets the input file.\n * @return input file\n */\ndef getInputFile()\n{\n // Check collector platform because it changes the file path.\n if (collector_platform == 'windows')\n {\n // Windows\n inputFile = new File('..\\\\\\\\logs\\\\\\\\' + filename)\n }\n else\n {\n // Linux\n inputFile = new File(\"../logs/\" + filename)\n }\n\n return inputFile\n}"}, "datapoints": [{"name": "TotalBytes", "description": "Total bytes", "interpretMethod": "expression", "interpretExpr": "(expandableCapacity + volumeCapacity)", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "expandableCapacity", "description": "Amount of bytes available for virtual volume expansion.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.expandableCapacity", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "healthState", "description": "Current health status.\n\n0=Error,\n1=Ok,", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.healthState", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "!= 1", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "VPLEX Virtual Volume ##INSTANCE## on ##HOST## is no longer in a healthy operating state, placing the device into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "operationalStatus", "description": "Current operating status.\n\n0=Error,\n1=Ok,", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.operationalStatus", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "!= 1", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "VPLEX Virtual Volume ##INSTANCE## on ##HOST## is no longer in an optimal operating state, placing the device into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "serviceStatus", "description": "Current service state.\n\n0=Not Running,\n1=Running", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.serviceStatus", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "volumeCapacity", "description": "Capacity of the volume in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.volumeCapacity", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Health State", "title": "Health State", "verticalLabel": "status code", "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "healthState", "datapointName": "healthState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "State", "color": "blue", "datapointName": "healthState", "isVirtual": false}]}, {"name": "Operational State", "title": "Operational State", "verticalLabel": "state", "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "operationalStatus", "datapointName": "operationalStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "green", "datapointName": "operationalStatus", "isVirtual": false}]}, {"name": "Service Status", "title": "Service Status", "verticalLabel": "status code", "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "serviceStatus", "datapointName": "serviceStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "fuchsia", "datapointName": "serviceStatus", "isVirtual": false}]}, {"name": "Storage", "title": "Storage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "TotalBytes", "datapointName": "TotalBytes", "consolidationFn": "average"}, {"name": "expandableCapacity", "datapointName": "expandableCapacity", "consolidationFn": "average"}, {"name": "volumeCapacity", "datapointName": "volumeCapacity", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Total", "color": "black", "datapointName": "TotalBytes", "isVirtual": false}, {"type": "stack", "legend": "Expandable", "color": "blue", "datapointName": "expandableCapacity", "isVirtual": false}, {"type": "stack", "legend": "Capacity", "color": "olive", "datapointName": "volumeCapacity", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Largest Virtual Volumes", "title": "Top 10 Largest Virtual Volumes", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "volumeCapacity", "datapointName": "volumeCapacity", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "volumeCapacity", "isVirtual": false}]}]}

×DataSource: Viptela_System_Fans (1133)

{"name": "Viptela_System_Fans", "description": "Monitors Viptela host system fan operating status and speed.", "appliesTo": "hasCategory(\"Viptela_vEdge\") || hasCategory(\"Viptela_vSmart\") || hasCategory(\"Viptela_vManage\") || hasCategory(\"Viptela_vBond\")", "searchKeywords": "sdwan,viptela", "displayedAs": "Viptela Fans", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname');\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n// Throw into a try/catch\ntry\n{\n // boolean value if we are in active discovery or collection mode.\n Boolean activeDiscovery = true\n\n /*\n The following SNMP walkAsMap will handle v1 , v2 and v3.\n Props contains a map of ALL host properties and the SNMP walk method will automatically\n handle the proper connection based on which SNMP version is configured.\n */\n\n // define maps we will walk.\n def hardwareEnvMeasurement_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.3.1.2.1.5\", props, timeout);\n def hardwareEnvStatus_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.3.1.2.1.4\", props, timeout);\n\n // regex pattern to capture fan speed\n def pattern = ~/^Spinning\\sat\\s(\\d+)\\sRPM/\n\n hardwareEnvMeasurement_map.each\n { key, val ->\n\n def instance_index = key.toString().tokenize('.').last()\n def instance_name = decodeToString(key)\n def wildvalue = \"${instance_name}_${instance_index}\".replaceAll(' ','_')\n\n // check our regex match\n def matcher = pattern.matcher(val);\n\n // if we've matched, then we are working with correct instances.\n if(matcher)\n {\n if(activeDiscovery)\n {\n println \"${wildvalue}##${instance_name} ${instance_index}\"\n }\n else\n {\n println \"${wildvalue}.status=\" + hardwareEnvStatus_map[key]\n println \"${wildvalue}.fan_speed=\" + matcher[0][1]\n }\n }\n }\n\n // execution was successful, return 0;\n return 0;\n}\n\ncatch (Exception e)\n{\n // if exception is caught, print it out and return 1;\n println e;\n return 1;\n}\n\n// Parse \".\" delimited char sequence encoding\ndef decodeToString(String encoded_string)\n{\n // Cast Integer to char if ASCII readable and join on ''\n def decoded = encoded_string.tokenize(\".\").collect()\n {\n if (Integer.parseInt(it) >= 32 && Integer.parseInt(it) < 127)\n {\n ((char) it.toInteger())\n }\n else\n {\n ''\n }\n }.join('')\n\n return decoded\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname');\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n// Throw into a try/catch\ntry\n{\n // boolean value if we are in active discovery or collection mode.\n Boolean activeDiscovery = false\n\n /*\n The following SNMP walkAsMap will handle v1 , v2 and v3.\n Props contains a map of ALL host properties and the SNMP walk method will automatically\n handle the proper connection based on which SNMP version is configured.\n */\n\n // define maps we will walk.\n def hardwareEnvMeasurement_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.3.1.2.1.5\", props, timeout);\n def hardwareEnvStatus_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.3.1.2.1.4\", props, timeout);\n\n // regex pattern to capture fan speed\n def pattern = ~/^Spinning\\sat\\s(\\d+)\\sRPM/\n\n hardwareEnvMeasurement_map.each\n { key, val ->\n\n def instance_index = key.toString().tokenize('.').last()\n def instance_name = decodeToString(key)\n def wildvalue = \"${instance_name}_${instance_index}\".replaceAll(' ','_')\n\n // check our regex match\n def matcher = pattern.matcher(val);\n\n // if we've matched, then we are working with correct instances.\n if(matcher)\n {\n if(activeDiscovery)\n {\n println \"${wildvalue}##${instance_name} ${instance_index}\"\n }\n else\n {\n println \"${wildvalue}.status=\" + hardwareEnvStatus_map[key]\n println \"${wildvalue}.fan_speed=\" + matcher[0][1]\n }\n }\n }\n\n // execution was successful, return 0;\n return 0;\n}\n\ncatch (Exception e)\n{\n // if exception is caught, print it out and return 1;\n println e;\n return 1;\n}\n\n// Parse \".\" delimited char sequence encoding\ndef decodeToString(String encoded_string)\n{\n // Cast Integer to char if ASCII readable and join on ''\n def decoded = encoded_string.tokenize(\".\").collect()\n {\n if (Integer.parseInt(it) >= 32 && Integer.parseInt(it) < 127)\n {\n ((char) it.toInteger())\n }\n else\n {\n ''\n }\n }.join('')\n\n return decoded\n}"}, "datapoints": [{"name": "fan_speed", "description": "Current fan speed, in RPM.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.fan_speed", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "status", "description": "Operating status of the system fan.\n\nStatus codes:\n0=Ok,\n1=Down,\n2=Failed", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "threshold": "!= 0 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Operating status of the system fan on ##HOST## is reporting a status code of ##VALUE##, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago.\n\nStatus codes:\n0=Ok,\n1=Down,\n2=Failed"}], "graphs": [{"name": "Speed", "title": "Speed", "verticalLabel": "rpm", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "fan_speed", "datapointName": "fan_speed", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "RPM", "color": "black", "datapointName": "fan_speed", "isVirtual": false}]}, {"name": "Status", "title": "Status", "verticalLabel": "0=ok, 1=down, 2=failed", "min": -1.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "status", "datapointName": "status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "silver", "datapointName": "status", "isVirtual": false}]}], "overviewGraphs": [{"name": "Fan Speed Overview", "title": "Fan Speed Overview", "verticalLabel": "rpm", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "fan_speed", "datapointName": "fan_speed", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "fan_speed", "isVirtual": false}]}, {"name": "Fan Status Overview", "title": "Fan Status Overview", "verticalLabel": "0=ok, 1=down, 2=failed", "min": -1.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "status", "datapointName": "status", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "status", "isVirtual": false}]}]}

×DataSource: Viptela_System_PSU (1135)

{"name": "Viptela_System_PSU", "description": "Monitors Viptela host power supply operating status, power status and fault status.", "appliesTo": "hasCategory(\"Viptela_vEdge\") || hasCategory(\"Viptela_vSmart\") || hasCategory(\"Viptela_vManage\") || hasCategory(\"Viptela_vBond\")", "searchKeywords": "sdwan,psu,viptela", "displayedAs": "Viptela PSU", "collectionInterval": "4m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname');\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n// Throw into a try/catch\ntry\n{\n // boolean value if we are in active discovery or collection mode.\n Boolean activeDiscovery = true\n\n /*\n The following SNMP walkAsMap will handle v1 , v2 and v3.\n Props contains a map of ALL host properties and the SNMP walk method will automatically\n handle the proper connection based on which SNMP version is configured.\n */\n\n // define maps we will walk.\n def hardwareEnvStatus_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.3.1.2.1.4\", props, timeout);\n def hardwareEnvMeasurement_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.3.1.2.1.5\", props, timeout);\n\n Map status_map =\n [\n 'yes':'1',\n 'no':'2'\n ]\n\n // regex pattern to match on\n def pattern = ~/^Powered\\sOn:\\s(\\w+);\\sFault:\\s(\\w+)/\n\n hardwareEnvMeasurement_map.each\n { key, val ->\n\n def instance_index = key.toString().tokenize('.').last()\n def instance_name = decodeToString(key)\n def wildvalue = \"${instance_name}_${instance_index}\".replaceAll(' ','_')\n\n // if we've matched, then we are working with correct instances.\n if(wildvalue.contains('Power_supply'))\n {\n if(activeDiscovery)\n {\n println \"${wildvalue}##${instance_name} ${instance_index}\"\n }\n else\n {\n // check our regex match\n def matcher = pattern.matcher(val);\n\n println \"${wildvalue}.status=\" + hardwareEnvStatus_map[key]\n println \"${wildvalue}.power_status=\" + status_map[matcher[0][1].toString()]\n println \"${wildvalue}.fault_status=\" + status_map[matcher[0][2].toString()]\n }\n }\n }\n\n // execution was successful, return 0;\n return 0;\n}\n\ncatch (Exception e)\n{\n // if exception is caught, print it out and return 1;\n println e;\n return 1;\n}\n\n/**\n * Helper method which handles converting snmp oid key into ASCII.\n * @param encoded_string\n * @return decoded string\n */\ndef decodeToString(String encoded_string)\n{\n // Cast Integer to char if ASCII readable and join on ''\n def decoded = encoded_string.tokenize(\".\").collect()\n {\n if (Integer.parseInt(it) >= 32 && Integer.parseInt(it) < 127)\n {\n ((char) it.toInteger())\n }\n else\n {\n ''\n }\n }.join('')\n\n return decoded\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname');\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n// Throw into a try/catch\ntry\n{\n // boolean value if we are in active discovery or collection mode.\n Boolean activeDiscovery = false\n\n /*\n The following SNMP walkAsMap will handle v1 , v2 and v3.\n Props contains a map of ALL host properties and the SNMP walk method will automatically\n handle the proper connection based on which SNMP version is configured.\n */\n\n // define maps we will walk.\n def hardwareEnvStatus_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.3.1.2.1.4\", props, timeout);\n def hardwareEnvMeasurement_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.3.1.2.1.5\", props, timeout);\n\n Map status_map =\n [\n 'yes':'1',\n 'no':'2'\n ]\n\n // regex pattern to match on\n def pattern = ~/^Powered\\sOn:\\s(\\w+);\\sFault:\\s(\\w+)/\n\n hardwareEnvMeasurement_map.each\n { key, val ->\n\n def instance_index = key.toString().tokenize('.').last()\n def instance_name = decodeToString(key)\n def wildvalue = \"${instance_name}_${instance_index}\".replaceAll(' ','_')\n\n // if we've matched, then we are working with correct instances.\n if(wildvalue.contains('Power_supply'))\n {\n if(activeDiscovery)\n {\n println \"${wildvalue}##${instance_name} ${instance_index}\"\n }\n else\n {\n // check our regex match\n def matcher = pattern.matcher(val);\n\n println \"${wildvalue}.status=\" + hardwareEnvStatus_map[key]\n println \"${wildvalue}.power_status=\" + status_map[matcher[0][1].toString()]\n println \"${wildvalue}.fault_status=\" + status_map[matcher[0][2].toString()]\n }\n }\n }\n\n // execution was successful, return 0;\n return 0;\n}\n\ncatch (Exception e)\n{\n // if exception is caught, print it out and return 1;\n println e;\n return 1;\n}\n\n/**\n * Helper method which handles converting snmp oid key into ASCII.\n * @param encoded_string\n * @return decoded string\n */\ndef decodeToString(String encoded_string)\n{\n // Cast Integer to char if ASCII readable and join on ''\n def decoded = encoded_string.tokenize(\".\").collect()\n {\n if (Integer.parseInt(it) >= 32 && Integer.parseInt(it) < 127)\n {\n ((char) it.toInteger())\n }\n else\n {\n ''\n }\n }.join('')\n\n return decoded\n}"}, "datapoints": [{"name": "Status", "description": "Operating status of the PSU.\n\nStatus codes:\n0=Ok,\n1=Down,\n2=Failed", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "fault_status", "description": "Fault status of the PSU.\n\nStatus codes:\n1=Faulted,\n2=Normal", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.fault_status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "1", "max": "2", "threshold": "!= 2 2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Fault status of the PSU on ##HOST## is reporting a status code of ##VALUE##, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago.\n\nStatus codes:\n1=Faulted,\n2=Normal"}, {"name": "power_status", "description": "Powered on status of the PSU.\n\nStatus codes:\n1=On,\n2=Off", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.power_status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "1", "max": "2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Fault Status", "title": "Fault Status", "verticalLabel": "1=faulted, 2=ok", "min": -1.0, "max": 3.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "fault_status", "datapointName": "fault_status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Fault Status", "color": "orange", "datapointName": "fault_status", "isVirtual": false}]}, {"name": "Operating Status", "title": "Operating Status", "verticalLabel": "0=ok, 1=down, 2=failed", "min": -1.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "blue", "datapointName": "Status", "isVirtual": false}]}, {"name": "Power State", "title": "Power State", "verticalLabel": "1=on, 2=off", "min": -1.0, "max": 3.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "power_status", "datapointName": "power_status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Power Status", "color": "olive", "datapointName": "power_status", "isVirtual": false}]}]}

×DataSource: Viptela_System_Status (1136)

{"name": "Viptela_System_Status", "description": "Monitors global operating status of the Viptela host.", "appliesTo": "hasCategory(\"Viptela_vEdge\") || hasCategory(\"Viptela_vSmart\") || hasCategory(\"Viptela_vManage\") || hasCategory(\"Viptela_vBond\")", "searchKeywords": "sdwan,viptela", "displayedAs": "Viptela Status", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname');\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n// Throw into a try/catch\ntry\n{\n /*\n The following SNMP walkAsMap will handle v1 , v2 and v3.\n Props contains a map of ALL host properties and the SNMP walk method will automatically\n handle the proper connection based on which SNMP version is configured.\n */\n\n // define maps we will walk.\n def systemStatus_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.11.1\", props, timeout);\n\n println \"systemState=\" + systemStatus_map['54.0']\n\n def uptime_raw = systemStatus_map['8.0'].toString()\n\n def regex_matcher = (uptime_raw =~ (/(\\d+)\\sdays\\s(\\d+)\\shrs\\s(\\d+)\\smin\\s(\\d+)\\ssec/))\n\n def days = regex_matcher[0][1].toInteger()\n def hours = regex_matcher[0][2].toInteger()\n def minutes = regex_matcher[0][3].toInteger()\n def seconds = regex_matcher[0][4].toInteger()\n\n println \"uptime=\" + ((days * 86400) + (hours * 3600) + (minutes * 60) + seconds)\n\n\n // execution was successful, return 0;\n return 0;\n}\n\ncatch (Exception e)\n{\n // if exception is caught, print it out and return 1;\n println e;\n return 1;\n}"}, "datapoints": [{"name": "systemState", "description": "Current system operating state.\n\nStatus codes:\n0=Blinking Green - system booting up,\n1=Green - system is fully functional and OMP connection is in the Up state,\n2=Yellow - system is up but OMP connection is in the Down state,\n3=Red - System has detected a major system level fault\u2014one of the necessary daemons in the system is down (system will usually reboot shortly after this)", "interpretMethod": "namevalue", "interpretExpr": "systemState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": ">= 2 3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "##HOST## is reporting a status code of ##VALUE##, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago.\n\n\n\nStatus codes:\n0=Blinking Green - system booting up,\n1=Green - system is fully functional and OMP connection is in the Up state,\n2=Yellow - system is up but OMP connection is in the Down state,\n3=Red - System has detected a major system level fault\u2014one of the necessary daemons in the system is down (system will usually reboot shortly after this)"}, {"name": "uptime", "description": "Current system uptime, in seconds.", "interpretMethod": "namevalue", "interpretExpr": "uptime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "uptime_days", "description": "System uptime, in days.", "interpretMethod": "expression", "interpretExpr": "uptime / 86400", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Operating Status", "title": "Operating Status", "verticalLabel": "1=ok, 2=warning, 3=critical", "min": 0.0, "max": 4.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "systemState", "datapointName": "systemState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "State", "color": "teal", "datapointName": "systemState", "isVirtual": false}]}, {"name": "Uptime", "title": "Uptime", "verticalLabel": "day(s)", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "uptime_days", "datapointName": "uptime_days", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Days", "color": "fuchsia", "datapointName": "uptime_days", "isVirtual": false}]}]}

×DataSource: Viptela_Policy_ApplicationAwareRouting (1156)

{"name": "Viptela_Policy_ApplicationAwareRouting", "description": "Monitors Viptela vEdge Application Aware Routing (AAR) Policy data and packet throughput metrics.", "appliesTo": "hasCategory(\"Viptela_vEdge\") || hasCategory(\"Viptela_vSmart\") || hasCategory(\"Viptela_vManage\") || hasCategory(\"Viptela_vBond\")", "searchKeywords": "sdwan,qos,network,viptela", "technicalNotes": "Please enable and configure SNMP on applicable Viptela devices.", "displayedAs": "Viptela Application Aware Routing Policy", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nimport java.security.MessageDigest\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname')\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n// Throw into a try/catch\ntry {\n // boolean value if we are in active discovery or collection mode.\n Boolean activeDiscovery = true\n\n /*\n The following SNMP walkAsMap will handle v1 , v2 and v3.\n Props contains a map of ALL host properties and the SNMP walk method will automatically\n handle the proper connection based on which SNMP version is configured.\n */\n\n // define maps we will walk.\n def aarPolicyCountsBytes_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.8.4.2.3.1.2\", props, timeout)\n def aarPolicyCountsPackets_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.8.4.2.3.1.3\", props, timeout)\n\n aarPolicyCountsBytes_map.each { key, val ->\n\n def wildalias = decodeToString(key)\n\n // Will use alias as value\n def wildvalue = MessageDigest.getInstance(\"MD5\").digest(wildalias.bytes).encodeHex()\n\n if (activeDiscovery) {\n println \"${wildvalue}##${wildalias}\"\n } else {\n println \"${wildvalue}.Bytes=\" + val\n println \"${wildvalue}.Packets=\" + aarPolicyCountsPackets_map[key]\n }\n }\n\n // execution was successful, return 0;\n return 0\n}\n\ncatch (Exception e) {\n // if exception is caught, print it out and return 1;\n println e\n return 1\n}\n\n/**\n * Helper method which handles converting snmp oid key into ASCII.\n * @param encoded_string\n * @return decoded string\n */\ndef decodeToString(String encoded_string) {\n // Cast Integer to char if ASCII readable and join on ''\n def decoded = encoded_string.tokenize(\".\").collect()\n {\n if (Integer.parseInt(it) >= 32 && Integer.parseInt(it) < 127) {\n ((char) it.toInteger())\n } else {\n ''\n }\n }.join('')\n\n return decoded\n}\n"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nimport java.security.MessageDigest\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname')\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n// Throw into a try/catch\ntry {\n // boolean value if we are in active discovery or collection mode.\n Boolean activeDiscovery = false\n\n /*\n The following SNMP walkAsMap will handle v1 , v2 and v3.\n Props contains a map of ALL host properties and the SNMP walk method will automatically\n handle the proper connection based on which SNMP version is configured.\n */\n\n // define maps we will walk.\n def aarPolicyCountsBytes_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.8.4.2.3.1.2\", props, timeout)\n def aarPolicyCountsPackets_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.8.4.2.3.1.3\", props, timeout)\n\n aarPolicyCountsBytes_map.each { key, val ->\n\n def wildalias = decodeToString(key)\n\n // Will use alias as value\n def wildvalue = MessageDigest.getInstance(\"MD5\").digest(wildalias.bytes).encodeHex()\n\n if (activeDiscovery) {\n println \"${wildvalue}##${wildalias}\"\n } else {\n println \"${wildvalue}.Bytes=\" + val\n println \"${wildvalue}.Packets=\" + aarPolicyCountsPackets_map[key]\n }\n }\n\n // execution was successful, return 0;\n return 0\n}\n\ncatch (Exception e) {\n // if exception is caught, print it out and return 1;\n println e\n return 1\n}\n\n/**\n * Helper method which handles converting snmp oid key into ASCII.\n * @param encoded_string\n * @return decoded string\n */\ndef decodeToString(String encoded_string) {\n // Cast Integer to char if ASCII readable and join on ''\n def decoded = encoded_string.tokenize(\".\").collect()\n {\n if (Integer.parseInt(it) >= 32 && Integer.parseInt(it) < 127) {\n ((char) it.toInteger())\n } else {\n ''\n }\n }.join('')\n\n return decoded\n}"}, "datapoints": [{"name": "BitsPerSecond", "description": "Number of bits per second for the application aware routing policy filter.", "interpretMethod": "expression", "interpretExpr": "BytesPerSecond*8", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesPerSecond", "description": "Number of bytes per second for application aware routing policy filters", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Bytes", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsPerSecond", "description": "Number of packets per second for application aware routing policy filters", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Packets", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Data Throughput", "title": "Data Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "bps", "datapointName": "BitsPerSecond", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Data", "color": "aqua", "datapointName": "bps", "isVirtual": false}]}, {"name": "Packet Throughput", "title": "Packet Throughput", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "packets", "datapointName": "PacketsPerSecond", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Packets", "color": "olive", "datapointName": "packets", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Policies by Data Throughput", "title": "Top 10 Policies by Data Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "bps", "datapointName": "BitsPerSecond", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "bps", "isVirtual": false}]}, {"name": "Top 10 Policies by Packet Throughput", "title": "Top 10 Policies by Packet Throughput", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "packets", "datapointName": "PacketsPerSecond", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "packets", "isVirtual": false}]}]}

×DataSource: Viptela_Policy_DataPolicyFilters (1157)

{"name": "Viptela_Policy_DataPolicyFilters", "description": "Monitors Viptela Data Policy data and packet throughput metrics.", "appliesTo": "hasCategory(\"Viptela_vEdge\") || hasCategory(\"Viptela_vSmart\") || hasCategory(\"Viptela_vManage\") || hasCategory(\"Viptela_vBond\")", "searchKeywords": "sdwan,qos,network,viptela", "technicalNotes": "Please enable and configure SNMP on applicable Viptela devices.", "displayedAs": "Viptela Data Policy", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nimport java.security.MessageDigest\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname')\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n// Throw into a try/catch\ntry {\n // boolean value if we are in active discovery or collection mode.\n Boolean activeDiscovery = true\n\n /*\n The following SNMP walkAsMap will handle v1 , v2 and v3.\n Props contains a map of ALL host properties and the SNMP walk method will automatically\n handle the proper connection based on which SNMP version is configured.\n */\n\n // define maps we will walk.\n def qosPolicyCountsBytes_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.8.4.1.3.1.2\", props, timeout)\n def qosPolicyCountsPackets_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.8.4.1.3.1.3\", props, timeout)\n\n qosPolicyCountsBytes_map.each { key, val ->\n\n def wildalias = decodeToString(key)\n\n // Will use alias as value\n def wildvalue = MessageDigest.getInstance(\"MD5\").digest(wildalias.bytes).encodeHex()\n\n if (activeDiscovery) {\n println \"${wildvalue}##${wildalias}\"\n } else {\n println \"${wildvalue}.Bytes=\" + val\n println \"${wildvalue}.Packets=\" + qosPolicyCountsPackets_map[key]\n }\n }\n\n // execution was successful, return 0;\n return 0\n}\n\ncatch (Exception e) {\n // if exception is caught, print it out and return 1;\n println e\n return 1\n}\n\n/**\n * Helper method which handles converting snmp oid key into ASCII.\n * @param encoded_string\n * @return decoded string\n */\ndef decodeToString(String encoded_string) {\n // Cast Integer to char if ASCII readable and join on ''\n def decoded = encoded_string.tokenize(\".\").collect()\n {\n if (Integer.parseInt(it) >= 32 && Integer.parseInt(it) < 127) {\n ((char) it.toInteger())\n } else {\n ''\n }\n }.join('')\n\n return decoded\n}\n"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nimport java.security.MessageDigest\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname')\ndef props = hostProps.toProperties()\ndef timeout = 10000 // 10 sec timeout.\n\n// Throw into a try/catch\ntry {\n // boolean value if we are in active discovery or collection mode.\n Boolean activeDiscovery = false\n\n /*\n The following SNMP walkAsMap will handle v1 , v2 and v3.\n Props contains a map of ALL host properties and the SNMP walk method will automatically\n handle the proper connection based on which SNMP version is configured.\n */\n\n // define maps we will walk.\n def qosPolicyCountsBytes_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.8.4.1.3.1.2\", props, timeout)\n def qosPolicyCountsPackets_map = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.8.4.1.3.1.3\", props, timeout)\n\n qosPolicyCountsBytes_map.each { key, val ->\n\n def wildalias = decodeToString(key)\n\n // Will use alias as value\n def wildvalue = MessageDigest.getInstance(\"MD5\").digest(wildalias.bytes).encodeHex()\n\n if (activeDiscovery) {\n println \"${wildvalue}##${wildalias}\"\n } else {\n println \"${wildvalue}.Bytes=\" + val\n println \"${wildvalue}.Packets=\" + qosPolicyCountsPackets_map[key]\n }\n }\n\n // execution was successful, return 0;\n return 0\n}\n\ncatch (Exception e) {\n // if exception is caught, print it out and return 1;\n println e\n return 1\n}\n\n/**\n * Helper method which handles converting snmp oid key into ASCII.\n * @param encoded_string\n * @return decoded string\n */\ndef decodeToString(String encoded_string) {\n // Cast Integer to char if ASCII readable and join on ''\n def decoded = encoded_string.tokenize(\".\").collect()\n {\n if (Integer.parseInt(it) >= 32 && Integer.parseInt(it) < 127) {\n ((char) it.toInteger())\n } else {\n ''\n }\n }.join('')\n\n return decoded\n}"}, "datapoints": [{"name": "BitsPerSecond", "description": "Number of bits per second for the data policy filter.", "interpretMethod": "expression", "interpretExpr": "BytesPerSecond*8", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesPerSecond", "description": "Number of bytes per second for data policy filters", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Bytes", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsPerSecond", "description": "Number of packets per second for data policy filters", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Packets", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Data Throughput", "title": "Data Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "bps", "datapointName": "BitsPerSecond", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Data", "color": "navy", "datapointName": "bps", "isVirtual": false}]}, {"name": "Packet Throughput", "title": "Packet Throughput", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "packets", "datapointName": "PacketsPerSecond", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Packets", "color": "olive", "datapointName": "packets", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 QoS Policies by Data Throughput", "title": "Top 10 QoS Policies by Data Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "bps", "datapointName": "BitsPerSecond", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "bps", "isVirtual": false}]}, {"name": "Top 10 QoS Policies by Packet Throughput", "title": "Top 10 QoS Policies by Packet Throughput", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "packets", "datapointName": "PacketsPerSecond", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "packets", "isVirtual": false}]}]}

×DataSource: VMware_ESXi_HostInterfaces (900)

{"name": "VMware_ESXi_HostInterfaces", "description": "Monitors network interfaces on the ESX host.", "appliesTo": "system.virtualization == \"VMWare ESX host\"", "searchKeywords": "interfaces,application,virtualization,vmware,esx", "technicalNotes": ":: replaces old ESX Host Interfaces- ::\n- define esx.user and esx.pass for authentication", "displayedAs": "VMware Network Interfaces", "collectionInterval": "1m", "collectionMethod": "esx", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2018 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.esx.ESX;\nimport com.vmware.vim25.mo.*;\n\ndef host = hostProps.get(\"system.hostname\");\ndef user = hostProps.get(\"esx.user\");\ndef pass = hostProps.get(\"esx.pass\");\ndef addr = hostProps.get(\"esx.url\") ?: \"https://${host}/sdk\";\n\n// To run in debug mode, set to true\ndef debug = false\n\nLMDebugPrint(\"Attempting discovery...\\n\\tHost: ${host}\\n\\tUser: ${user}\\n\\tAddress: ${addr}\", debug)\n\ndef svc = new ESX();\nsvc.open(addr, user, pass, 10 * 1000); // timeout in 10 seconds\n\ndef si = svc.getServiceInstance();\ndef rootFolder = si.getRootFolder();\n\n// Get resource clusters\nHostSystem[] esxHosts = new InventoryNavigator(rootFolder).searchManagedEntities(\"HostSystem\")\n\nif (!esxHosts) {\n LMDebugPrint(\"No resource clusters found\", debug)\n}\n\n// Iterate over each physical NIC\nesxHosts.each { esx ->\n LMDebugPrint(\"Checking host ${esx} for physical NICs...\", debug)\n esx?.hostNetworkSystem?.networkInfo?.pnic?.each() { nic ->\n // Is the nic active?\n if (nic.linkSpeed) {\n LMDebugPrint(\"\\tActive NIC found (${nic}), adding instance...\")\n\n // Yes, collect instance information.\n def wildvalue = nic.device;\n def wildalias = \"${wildvalue} / ${nic.mac}\";\n def description = \"${nic.linkSpeed.speedMb} Mbps ${nic.linkSpeed.duplex ? 'full-duplex' : ''}\";\n\n // print out instance information.\n ExternalResourceIDs = [\"${host}--pNic-${nic.mac}\"]\n\n // Collect properties\n instance_props = ['auto.mac_address' : nic.mac,\n 'auto.ifSpeedMb' : nic.linkSpeed.speedMb,\n 'predef.externalResourceID' : ExternalResourceIDs.join(\",\"),\n 'predef.externalResourceType': \"PhysicalNIC\"\n ]\n\n // Encode our properties\n encoded_instance_props_array = instance_props.collect()\n { property, value ->\n URLEncoder.encode(property.toString()) + \"=\" + URLEncoder.encode(value.toString())\n }\n //def properties = \"auto.mac_address=${nic.mac}&auto.ifSpeedMb=${nic.linkSpeed.speedMb}\";\n println \"${wildvalue}##${wildalias}##${description}####${encoded_instance_props_array.join(\"&\")}\"\n }\n else {\n LMDebugPrint(\"\\tNIC found (${nic}) is NOT active.\")\n }\n }\n}\n\nreturn 0;\n\n\n/**\n * Helper function to print out debug messages for troubleshooting purposes.\n * @param message\n * @param debug\n */\ndef LMDebugPrint(message, debug=false) {\n if (debug) {\n println(message.toString())\n }\n}"}, "groupMethod": "none"}, "datapoints": [{"name": "NetPacketsRx", "description": "Number of packets received during the previous 20 seconds.", "config": {"counter": "net.packetsRx.summation", "entity": "network"}, "interpretMethod": "none", "useValue": "output", "type": "gauge", "dataType": 5, "min": "0", "threshold": "= 0 0", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "Interface ##INSTANCE## (##DSIDESCRIPTION##) on ESX host ##HOST## has not received any packets recently, placing the interface into ##LEVEL## state.\n\nMost likely there is a network connectivity issue - check link status and the connected switch port.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "NetPacketsTx", "description": "Number of packets transmitted during the previous 20 seconds.", "config": {"counter": "net.packetsTx.summation", "entity": "network"}, "interpretMethod": "none", "useValue": "output", "type": "gauge", "dataType": 5, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "NetReceivedAverage", "description": "Rate of received traffic in Kbytes/second.", "config": {"counter": "net.received.average", "entity": "network"}, "interpretMethod": "none", "useValue": "output", "type": "gauge", "dataType": 5, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "NetTransmittedAverage", "description": "Rate of sent traffic in Kbytes/second.", "config": {"counter": "net.transmitted.average", "entity": "network"}, "interpretMethod": "none", "useValue": "output", "type": "gauge", "dataType": 5, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "droppedRx", "description": "Number of receive packets dropped during prior 20 seconds", "config": {"counter": "net.droppedRx.summation", "entity": "network"}, "interpretMethod": "none", "useValue": "output", "type": "gauge", "dataType": 5, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "droppedTx", "description": "Number of sent packets dropped during prior 20 seconds", "config": {"counter": "net.droppedTx.summation", "entity": "network"}, "interpretMethod": "none", "type": "gauge", "dataType": 5, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}], "graphs": [{"name": "Dropped Packets", "title": "Dropped Packets", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "droppedRx", "datapointName": "droppedRx", "consolidationFn": "average"}, {"name": "droppedTx", "datapointName": "droppedTx", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "RxDropsperSec", "expr": "droppedRx/20"}, {"name": "TxDropsperSec", "expr": "DroppedTx/20"}], "lines": [{"type": "stack", "legend": "Dropped Inbound", "color": "orange", "datapointName": "RxDropsperSec", "isVirtual": true}, {"type": "stack", "legend": "Dropped Outbound", "color": "red2", "datapointName": "TxDropsperSec", "isVirtual": true}]}, {"name": "Packet Transmission", "title": "Packet Transmission", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "NetPacketsRx", "datapointName": "NetPacketsRx", "consolidationFn": "average"}, {"name": "NetPacketsTx", "datapointName": "NetPacketsTx", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "RxPackets", "expr": "NetPacketsRx/20"}, {"name": "TxPackets", "expr": "NetPacketsTx/20"}], "lines": [{"type": "stack", "legend": "Inbound", "color": "teal", "datapointName": "RxPackets", "isVirtual": true}, {"type": "stack", "legend": "Outbound", "color": "olive", "datapointName": "TxPackets", "isVirtual": true}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "NetReceivedAverage", "datapointName": "NetReceivedAverage", "consolidationFn": "average"}, {"name": "NetTransmittedAverage", "datapointName": "NetTransmittedAverage", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Rxbps", "expr": "NetReceivedAverage*8*1000"}, {"name": "Txbps", "expr": "NetTransmittedAverage*8*1000"}], "lines": [{"type": "stack", "legend": "Inbound", "color": "blue", "datapointName": "Rxbps", "isVirtual": true}, {"type": "stack", "legend": "Outbound", "color": "green", "datapointName": "Txbps", "isVirtual": true}]}], "overviewGraphs": [{"name": "Top 10 Interfaces by Throughput", "title": "Top 10 Interfaces by Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "NetReceivedAverage", "datapointName": "NetReceivedAverage", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "NetTransmittedAverage", "datapointName": "NetTransmittedAverage", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "bps", "expr": "(NetTransmittedAverage+NetReceivedAverage)*8*1000"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "bps", "isVirtual": true}]}]}

×DataSource: HP_Chassis_Fans (1586)

{"name": "HP_Chassis_Fans", "description": "Monitors HP chassis fault tolerant fan operating condition, redundancy, speed, etc.", "appliesTo": "system.sysinfo =~ \"Integrated Lights-Out\"", "searchKeywords": "fan,hp,chassis,ilo,hardware", "displayedAs": "Chassis Fans", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get(\"system.hostname\")\n\n// gather all properties necessary.\ndef props = hostProps.toProperties()\ndef timeout = 5000 // Timeout in milliseconds\n\n// Fan location key\nMap fanLocationKey_map =\n [\n '1' : 'Other',\n '2' : 'Unknown',\n '3' : 'System',\n '4' : 'System Board',\n '5' : 'IO Board',\n '6' : 'CPU',\n '7' : 'Memory',\n '8' : 'Storage',\n '9' : 'Removable Media',\n '10': 'Power Supply',\n '11': 'Ambient',\n '12': 'Chassis',\n '13': 'Bridge Card',\n '14': 'Management Board',\n '15': 'Backplane',\n '16': 'Network Slot',\n '17': 'Blade Slot',\n '18': 'Virtual'\n ]\n\ndef fanLocation_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.6.2.6.7.1.3\", props, timeout)\ndef fanPresent_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.6.2.6.7.1.4\", props, timeout)\n\nfanPresent_WalkAsMap.each\n { instance_index, fanValue ->\n\n // Is the fan present ?\n // 1 = other, 2 = absent, 3 = present\n if (fanValue == '3') {\n\n def (chassis_index, fan_index) = instance_index.toString().split(/\\./)\n\n println \"${instance_index}##Chassis ${chassis_index} : Fan ${fan_index}##Location: ${fanLocationKey_map[fanLocation_WalkAsMap[instance_index]]}####\" +\n \"auto.fan.chassis=${chassis_index}&\" +\n \"auto.fan.location=${fanLocationKey_map[fanLocation_WalkAsMap[instance_index]]}\"\n }\n }\n\n// Successful script execution, return 0;\nreturn 0\n"}, "groupMethod": "ilp", "groupExpr": "auto.fan.location"}, "datapoints": [{"name": "Health", "description": "Current health condition of the fan.\n\nStatus Codes:\n1=Other,\n2=Ok, \n3=Degraded, \n4=Failed", "config": {"oid": "1.3.6.1.4.1.232.6.2.6.7.1.9.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "threshold": "> 2", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## (##DSIDESCRIPTION##) on HP host ##HOST## is no longer in an optimal operating state and is reporting a status of ##VALUE##, placing the fan into ##LEVEL## state.\n\nStatus Codes:\n1=Other,\n2=Ok, \n3=Degraded, \n4=Failed\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "hotpluggable", "description": "Indicates if the fan is capable of being removed and/or inserted while system is in operation state. \n\nStatus Codes:\n1=Other, \n2=No, \n3=Yes", "config": {"oid": "1.3.6.1.4.1.232.6.2.6.7.1.10.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "redundant", "description": "Redundancy status of the fan.\n\nStatus Codes:\n1=Other, \n2=Not-Redundant, \n3=Redundant", "config": {"oid": "1.3.6.1.4.1.232.6.2.6.7.1.7.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "speed", "description": "Current speed state of the fan.\n\nStatus Codes:\n1=Other, \n2=Normal Speed, \n3=High Speed", "config": {"oid": "1.3.6.1.4.1.232.6.2.6.7.1.6.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "3", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0}, {"name": "type", "description": "Fan type.\n\n1=Other, \n2=Fan is capable of increasing speed for greater cooling, \n3=Capable of detecting if fan stops spinning.", "config": {"oid": "1.3.6.1.4.1.232.6.2.6.7.1.5.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Health State", "title": "Health State", "verticalLabel": "status codes", "min": 0.0, "max": 5.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Health", "datapointName": "Health", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Health State", "color": "silver", "datapointName": "Health", "isVirtual": false}]}, {"name": "Hot-Pluggable", "title": "Hot-Pluggable", "verticalLabel": "status code", "min": 0.0, "max": 4.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "hotpluggable", "datapointName": "hotpluggable", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Hot Pluggable Status", "color": "orange2", "datapointName": "hotpluggable", "isVirtual": false}]}, {"name": "Redundancy Status", "title": "Redundancy Status", "verticalLabel": "status code", "min": 0.0, "max": 4.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "redundant", "datapointName": "redundant", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Redundancy Status", "color": "green", "datapointName": "redundant", "isVirtual": false}]}, {"name": "Speed State", "title": "Speed State", "verticalLabel": "status code", "min": 0.0, "max": 4.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "speed", "datapointName": "speed", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Speed Status", "color": "yellow", "datapointName": "speed", "isVirtual": false}]}, {"name": "Type", "title": "Type", "verticalLabel": "status code", "min": 0.0, "max": 4.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "type", "datapointName": "type", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Type", "color": "fuchsia", "datapointName": "type", "isVirtual": false}]}], "overviewGraphs": [{"name": "Health State Overview", "title": "Health State Overview", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Health", "datapointName": "Health", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Health", "isVirtual": false}]}]}

×DataSource: HP_Chassis_MemoryBoards (1585)

{"name": "HP_Chassis_MemoryBoards", "description": "Monitors the chassis memory slot health condition, error status, online status, etc.", "appliesTo": "system.sysinfo =~ \"Integrated Lights-Out\"", "searchKeywords": "memory,hp,chassis,hardware", "displayedAs": "Memory Boards", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get(\"system.hostname\")\n\n// gather all properties necessary.\ndef props = hostProps.toProperties()\ndef timeout = 5000 // Timeout in milliseconds\n\ntry {\n def memoryBoardSlotNumber_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.6.2.14.12.1.2\", props, timeout)\n\n memoryBoardSlotNumber_WalkAsMap.each\n { key, val ->\n\n println \"${key}##Memory Board ${key} : Slot ${val}\"\n }\n\n // Successful script execution, return 0;\n return 0\n}\ncatch (Exception e) {\n println e\n return 1\n}\n"}, "groupMethod": "none"}, "datapoints": [{"name": "Health", "description": "Current health status of the Advanced Memory Protection memory board or cartridge or riser.\n\nStatus Codes:\n0=Unknown - Value outside of spec.\n1=Other - cannot be determined,\n2=Ok - normal operation,\n3=Degraded - memory board or cartridge or riser is in an error state. Check for correct memory installation and that the board has been inserted properly.", "config": {"oid": ".1.3.6.1.4.1.232.6.2.14.12.1.11.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "max": "3", "threshold": "> 2", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## on HP host ##HOST## is no longer in its optimal health state and has reported a status of ##VALUE##, placing it into ##LEVEL## state.\n\nStatus Codes:\n1=Other - cannot be determined,\n2=Ok - normal operation,\n3=Degraded - memory board or cartridge or riser is in an error state. Check for correct memory installation and that the board has been inserted properly.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "OSMemory", "description": "Memory as seen by the operating system, in bytes.\n\nIf this system does not support Advanced Memory Protection or this\nvalue cannot be determined, then a value of 0 will be returned.", "config": {}, "interpretMethod": "expression", "interpretExpr": "OSMemory_raw * 1024 * 1024", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OSMemory_raw", "description": "Memory as seen by the operating system, in megabytes.\n\nIf this system does not support Advanced Memory Protection or this\nvalue cannot be determined, then a value of 0 will be returned.", "config": {"oid": ".1.3.6.1.4.1.232.6.2.14.12.1.9.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "errorStatusAlert", "description": "Error status of the board.\n\nStatus Codes:\n1=Other - unsupported or could not be determined,\n2=Ok,\n3=DIMM ECC Error - at least one DIMM ECC error.\n4=Unlock Error - unlocked when it should not be. Insure the board of cartridge is locked.\n5=Config Error - bad memory configuration. Insure all memory modules are of the correct type/speed/latency/etc.\n6=Bus Error - memory bus error. Insure all memory modules are of the correct type/speed/latency/etc. and is inserted properly.\n7=Power Error - PInsure all memory modules are of the correct type/speed/latency/etc. and is inserted properly.\n8=Advanced ECC - board/cartridge/riser configured for advanced ECC mode,\n9=Online Spare - board/cartridge/riser configured for online spare mode,\n10=Mirrored - board/cartridge/riser configured for mirrored mode,\n11=Mirrored DIMM Error,\n12=Memory RAID - board/cartridge/riser configured for memory RAID mode,\n13=RAID DIMM Error,\n14=Lock Step - board/cartridge/riser configured for lock step mode,\n15=Lock Step Error", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(in(3,4,5,6,7,11,13,15,errorStatusRaw),errorStatusRaw,0)", "type": "gauge", "dataType": 7, "min": "0", "max": "15", "threshold": "!= 0 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## on HP host ##HOST## has reported an error status code of ##VALUE##, placing it into ##LEVEL## state.\n\nStatus Codes:\n1=Other - unsupported or could not be determined,\n2=Ok,\n3=DIMM ECC Error - at least one DIMM ECC error.\n4=Unlock Error - unlocked when it should not be. Insure the board of cartridge is locked.\n5=Config Error - bad memory configuration. Insure all memory modules are of the correct type/speed/latency/etc.\n6=Bus Error - memory bus error. Insure all memory modules are of the correct type/speed/latency/etc. and is inserted properly.\n7=Power Error - PInsure all memory modules are of the correct type/speed/latency/etc. and is inserted properly.\n8=Advanced ECC - board/cartridge/riser configured for advanced ECC mode,\n9=Online Spare - board/cartridge/riser configured for online spare mode,\n10=Mirrored - board/cartridge/riser configured for mirrored mode,\n11=Mirrored DIMM Error,\n12=Memory RAID - board/cartridge/riser configured for memory RAID mode,\n13=RAID DIMM Error,\n14=Lock Step - board/cartridge/riser configured for lock step mode,\n15=Lock Step Error\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "errorStatusRaw", "description": "Error status of the board.\n\nStatus Codes:\n1=Other - unsupported or could not be determined,\n2=Ok,\n3=DIMM ECC Error - at least one DIMM ECC error.\n4=Unlock Error - unlocked when it should not be. Insure the board of cartridge is locked.\n5=Config Error - bad memory configuration. Insure all memory modules are of the correct type/speed/latency/etc.\n6=Bus Error - memory bus error. Insure all memory modules are of the correct type/speed/latency/etc. and is inserted properly.\n7=Power Error - PInsure all memory modules are of the correct type/speed/latency/etc. and is inserted properly.\n8=Advanced ECC - board/cartridge/riser configured for advanced ECC mode,\n9=Online Spare - board/cartridge/riser configured for online spare mode,\n10=Mirrored - board/cartridge/riser configured for mirrored mode,\n11=Mirrored DIMM Error,\n12=Memory RAID - board/cartridge/riser configured for memory RAID mode,\n13=RAID DIMM Error,\n14=Lock Step - board/cartridge/riser configured for lock step mode,\n15=Lock Step Error", "config": {"oid": ".1.3.6.1.4.1.232.6.2.14.12.1.6.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "onlineStatus", "description": "Online status of the board.\n\nStatus Codes:\n1=Other - unsupported or could not be determined,\n2=Present - memory present and is online,\n3=Absent - missing or offline", "config": {"oid": ".1.3.6.1.4.1.232.6.2.14.12.1.5.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operatingFrequency", "description": "Memory operating frequency, in Mhz.", "config": {"oid": ".1.3.6.1.4.1.232.6.2.14.12.1.13.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operatingVoltage", "description": "Memory operation in volts.", "config": {}, "interpretMethod": "expression", "interpretExpr": "operatingVoltage_raw / 1000", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operatingVoltage_raw", "description": "Memory operation in millivolts.", "config": {"oid": ".1.3.6.1.4.1.232.6.2.14.12.1.14.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "totalMemory", "description": "Total memory size of this board, in bytes.\n\nIf this system does not support Advanced Memory Protection or this\nvalue cannot be determined, then a value of 0 will be returned.", "config": {}, "interpretMethod": "expression", "interpretExpr": "totalMemory_raw * 1024 * 1024", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "totalMemory_raw", "description": "Total memory, in megabytes.", "config": {"oid": ".1.3.6.1.4.1.232.6.2.14.12.1.10.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Error Status", "title": "Error Status", "verticalLabel": "status codes", "min": 0.0, "max": 16.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "errorStatus", "datapointName": "errorStatusRaw", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Error Status", "color": "red", "datapointName": "errorStatus", "isVirtual": false}]}, {"name": "Health State", "title": "Health State", "verticalLabel": "status code", "min": 0.0, "max": 4.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Health", "datapointName": "Health", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Health State", "color": "silver", "datapointName": "Health", "isVirtual": false}]}, {"name": "Memory", "title": "Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "OSMemory", "datapointName": "OSMemory", "consolidationFn": "average"}, {"name": "totalMemory", "datapointName": "totalMemory", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "OS", "color": "olive", "datapointName": "OSMemory", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "totalMemory", "isVirtual": false}]}, {"name": "Online Status", "title": "Online Status", "verticalLabel": "status code", "min": 0.0, "max": 4.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "onlineStatus", "datapointName": "onlineStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Online Status", "color": "aqua", "datapointName": "onlineStatus", "isVirtual": false}]}, {"name": "Operating Frequency", "title": "Operating Frequency", "verticalLabel": "Mhz", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "operatingFrequency", "datapointName": "operatingFrequency", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Frequency", "color": "fuchsia", "datapointName": "operatingFrequency", "isVirtual": false}]}, {"name": "Operating Voltage", "title": "Operating Voltage", "verticalLabel": "volts", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "operatingVoltage", "datapointName": "operatingVoltage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Volts", "color": "yellow", "datapointName": "operatingVoltage", "isVirtual": false}]}], "overviewGraphs": [{"name": "Health State Overview", "title": "Health State Overview", "verticalLabel": "status code", "min": 0.0, "max": 4.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "condition", "datapointName": "Health", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "condition", "isVirtual": false}]}]}

×DataSource: HP_Chassis_MemoryModules (1584)

{"name": "HP_Chassis_MemoryModules", "description": "Status and condition of HP memory modules.", "appliesTo": "system.sysinfo =~ \"Integrated Lights-Out\"", "searchKeywords": "memory,hp,chassis,ilo,hardware", "displayedAs": "Memory Modules", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get(\"system.hostname\")\n\n// gather all properties necessary.\ndef props = hostProps.toProperties()\ndef timeout = 5000 // Timeout in milliseconds\n\nMap moduleTypeKey_map =\n [\n '1' : 'Other',\n '2' : 'Board',\n '3' : 'CPQ Single Width Module',\n '4' : 'CPQ Double Width Module',\n '5' : 'SIMM',\n '6' : 'PC Card',\n '7' : 'Compaq Specifc',\n '8' : 'DIMM',\n '9' : 'Small Outline DIMM',\n '10': 'RIMM',\n '11': 'SRIMM',\n '12': 'Fully Buffered DIMM',\n '13': 'DIM DDR',\n '14': 'DIM DDR2',\n '15': 'DIM DDR3',\n '16': 'DIM FBD2',\n '17': 'Fully Buffered DIM DDR2',\n '18': 'Fully Buffered DIM DDR3'\n ]\n\ntry {\n def moduleType_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.6.2.14.13.1.7\", props, timeout)\n def modulePartNumber_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.6.2.14.13.1.10\", props, timeout)\n def moduleLocation_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.6.2.14.13.1.13\", props, timeout)\n def moduleFrequency_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.6.2.14.13.1.14\", props, timeout)\n\n moduleLocation_WalkAsMap.each\n { key, val ->\n\n println \"${key}##${val}######\" +\n \"auto.module.location=${val}&\" +\n \"auto.module.part_number=${modulePartNumber_WalkAsMap[key]}&\" +\n \"auto.module.frequency=${moduleFrequency_WalkAsMap[key]} MHz&\" +\n \"auto.module.type=${moduleTypeKey_map[moduleType_WalkAsMap[key]]}\"\n }\n\n // Successful script execution, return 0;\n return 0\n}\ncatch (Exception e) {\n println e\n return 1\n}\n"}, "groupMethod": "ilp", "groupExpr": "auto.module.type"}, "datapoints": [{"name": "condition", "description": "Current condition of the module.\n\nStatus Codes:\n1=Other - ECC is not supported on this module or condition cannot be determined, \n2=OK - Normal operation, \n3=Degraded - module correctable error count has exceeded threshold or config error detected,\n4=Degraded Module Index Unknown - correctable error count exceeded threshold, module not available.", "config": {"oid": ".1.3.6.1.4.1.232.6.2.14.13.1.20.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "threshold": "> 2 2", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "Memory module ##INSTANCE## on HP host ##HOST## is no longer in its optimal condition state and has reported a status code of ##VALUE##, placing the module into ##LEVEL## state.\n\nStatus Codes:\n1=Other - ECC is not supported on this module or condition cannot be determined, \n2=OK - Normal operation, \n3=Degraded - module correctable error count has exceeded threshold or config error detected,\n4=Degraded Module Index Unknown - correctable error count exceeded threshold, module not available.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "status", "description": "Current operating status of the memory module.\n\nStatus Codes:\n1=Other - unable to determine status, \n2=Not Present - module is either not present or un-initialized, \n3=Present - present but not in use, \n4=Good - present and in use, \n5=Add - module has been added but not yet in use, \n6=Upgrade - module has been upgraded but not yet in use, \n7=Missing - expected module is missing, \n8=Does not match - module does not match the other modules in the bank, \n9=Not supported, \n10=Bad config - module violates add/upgrade config rules, \n11=Degraded - correctable error count exceeded threshold,\n12=Spare - configured as spare,\n13=Partial - present and is partially in use.", "config": {"oid": ".1.3.6.1.4.1.232.6.2.14.13.1.19.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "13", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "statusAlert", "description": "Status alerting.\n\nStatus Codes:\n1=Other - unable to determine status, \n2=Not Present - module is either not present or un-initialized, \n3=Present - present but not in use, \n4=Good - present and in use, \n5=Add - module has been added but not yet in use, \n6=Upgrade - module has been upgraded but not yet in use, \n7=Missing - expected module is missing, \n8=Does not match - module does not match the other modules in the bank, \n9=Not supported, \n10=Bad config - module violates add/upgrade config rules, \n11=Degraded - correctable error count exceeded threshold,\n12=Spare - configured as spare,\n13=Partial - present and is partially in use.", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(in(7,9,10,11,status),status,0)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 0 0", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "Memory module ##INSTANCE## on HP host ##HOST## is no longer in its optimal operating status and has reported a status code of ##VALUE##, placing the module into ##LEVEL## state.\n\nStatus Codes:\n1=Other - unable to determine status, \n2=Not Present - module is either not present or un-initialized, \n3=Present - present but not in use, \n4=Good - present and in use, \n5=Add - module has been added but not yet in use, \n6=Upgrade - module has been upgraded but not yet in use, \n7=Missing - expected module is missing, \n8=Does not match - module does not match the other modules in the bank, \n9=Not supported, \n10=Bad config - module violates add/upgrade config rules, \n11=Degraded - correctable error count exceeded threshold,\n12=Spare - configured as spare,\n13=Partial - present and is partially in use.\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Module Condition", "title": "Module Condition", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "condition", "datapointName": "condition", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Condition Status", "color": "silver", "datapointName": "condition", "isVirtual": false}]}, {"name": "Module Status", "title": "Module Status", "verticalLabel": "status code", "min": 0.0, "max": 14.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "status", "datapointName": "status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "olive", "datapointName": "status", "isVirtual": false}]}], "overviewGraphs": [{"name": "Module Status Overview", "title": "Module Status Overview", "verticalLabel": "status code", "min": 0.0, "max": 14.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "status", "datapointName": "status", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "status", "isVirtual": false}]}]}

×DataSource: HP_Chassis_PowerSupplies (1583)

{"name": "HP_Chassis_PowerSupplies", "description": "Monitors system power supply operating status, condition, fault tolerance and redundancy.", "appliesTo": "system.sysinfo =~ \"Integrated Lights-Out\"", "searchKeywords": "psu,hp,ilo,power supply,hardware", "displayedAs": "Power Supplies", "collectionInterval": "4m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get(\"system.hostname\")\n\n// gather all properties necessary.\ndef props = hostProps.toProperties()\ndef timeout = 5000 // Timeout in milliseconds\n\ntry {\n def psuPresent_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.6.2.9.3.1.3\", props, timeout)\n def psuModel_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.6.2.9.3.1.10\", props, timeout)\n def psuSerialNumber_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.6.2.9.3.1.11\", props, timeout)\n\n psuPresent_WalkAsMap.each\n { key, val ->\n\n // check presence status\n if (val != '2') {\n def (chassis, bay) = key.toString().split(/\\./)\n\n println \"${key}##Chassis ${chassis} : Bay ${bay} PSU######\" +\n \"auto.psu.model=${psuModel_WalkAsMap[key]}&\" +\n \"auto.psu.serial_number=${psuSerialNumber_WalkAsMap[key]}\"\n }\n }\n\n // Successful script execution, return 0;\n return 0\n}\ncatch (Exception e) {\n println e\n return 1\n}\n"}, "groupMethod": "none"}, "datapoints": [{"name": "capacityMaximum", "description": "Maximum capacity of the PSU, in watts.", "config": {"oid": ".1.3.6.1.4.1.232.6.2.9.3.1.8.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "capacityUsed", "description": "Current used capacity of the PSU, in watts.", "config": {"oid": ".1.3.6.1.4.1.232.6.2.9.3.1.7.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "capacityUtilization", "description": "Percent utilization of the PSU's maximum capacity.", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(eq(capacityMaximum,0), 0, ( capacityUsed / capacityMaximum ) * 100)", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": ">= 85", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## on HP host ##HOST## is reporting high power utilization of ##VALUE## % of its maximum capacity, placing the PSU into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "condition", "description": "Condition of the power supply.\n\nStatus Codes:\n1=Other,\n2=Ok,\n3=Degraded,\n4=Failed", "config": {"oid": ".1.3.6.1.4.1.232.6.2.9.3.1.4.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "max": "4", "threshold": "> 2 3", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 2, "alertBody": "##INSTANCE## on HP host ##HOST## is no longer its optimal condition state and has reported a status of ##VALUE##, placing the PSU into ##LEVEL## state.\n\nStatus Codes:\n1=Other,\n2=Ok,\n3=Degraded,\n4=Failed\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "errorCondition", "description": "Error condition on the power supply.\n\nStatus Codes:\n1=No Error,\n2=General Failure,\n3=Over Voltage,\n4=Over Current,\n5=Over Temperature,\n6=Power Input Loss,\n7=Fan Failure,\n8=VIN High Warning,\n9=VIN Low Warning,\n10=VOUT High Warning,\n11=VOUT Low Warning,\n12=Inlet Temperature High Warning,\n13=Internal Temperature High Warning,\n14=VAUX High Warning,\n15=VAUX Low Warning", "config": {"oid": ".1.3.6.1.4.1.232.6.2.9.3.1.18.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "15", "threshold": "!= 1", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "##INSTANCE## on HP host ##HOST## has reported an error status code of ##VALUE##, placing the PSU into ##LEVEL## state.\n\nStatus Codes:\n1=No Error,\n2=General Failure,\n3=Over Voltage,\n4=Over Current,\n5=Over Temperature,\n6=Power Input Loss,\n7=Fan Failure,\n8=VIN High Warning,\n9=VIN Low Warning,\n10=VOUT High Warning,\n11=VOUT Low Warning,\n12=Inlet Temperature High Warning,\n13=Internal Temperature High Warning,\n14=VAUX High Warning,\n15=VAUX Low Warning\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "hotPluggable", "description": "Indicates if the power supply is cable of being removed and/or inserted while system is operational.\n\nStatus Codes:\n1=Other,\n2=Not Hot Pluggable,\n3=Hot Pluggable", "config": {"oid": ".1.3.6.1.4.1.232.6.2.9.3.1.13.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mainVoltage", "description": "Input main voltage of the PSU, in volts.", "config": {"oid": ".1.3.6.1.4.1.232.6.2.9.3.1.6.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "redundancy", "description": "Redundancy status of the PSU.\n\nStatus Codes:\n1=Other,\n2=Not Redundant,\n3=Redundant", "config": {"oid": ".1.3.6.1.4.1.232.6.2.9.3.1.9.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "threshold": "= 2", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## on HP host ##HOST## is not redundant, placing it into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "status", "description": "Current status of the PSU.\n\nStatus Codes:\n1=No Error,\n2=General Failure,\n3=BIST Failure,\n4=Fan Failure,\n5=Temperature Failure,\n6=Interlock Open\n7=EPROM Failed,\n8=VREF Failed,\n9=DAC Failed,\n10=RAM test failed,\n11=Voltage Channel Failure,\n12=ORing Diode Failure,\n13=Brown Out,\n14=Give up or startup,\n15=NVRAM Invalid,\n16=Calibration Table Invalid,\n17=No Power Input", "config": {"oid": ".1.3.6.1.4.1.232.6.2.9.3.1.5.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 1", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "##INSTANCE## on HP host ##HOST## is no longer its optimal operating state and has reported a status of ##VALUE##, placing the PSU into ##LEVEL## state.\n\nStatus Codes:\n1=No Error,\n2=General Failure,\n3=BIST Failure,\n4=Fan Failure,\n5=Temperature Failure,\n6=Interlock Open\n7=EPROM Failed,\n8=VREF Failed,\n9=DAC Failed,\n10=RAM test failed,\n11=Voltage Channel Failure,\n12=ORing Diode Failure,\n13=Brown Out,\n14=Give up or startup,\n15=NVRAM Invalid,\n16=Calibration Table Invalid,\n17=No Power Input\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Capacity", "title": "Capacity", "verticalLabel": "watts", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "capacityMaximum", "datapointName": "capacityMaximum", "consolidationFn": "average"}, {"name": "capacityUsed", "datapointName": "capacityUsed", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Maximum", "color": "black", "datapointName": "capacityMaximum", "isVirtual": false}, {"type": "area", "legend": "Used", "color": "fuchsia", "datapointName": "capacityUsed", "isVirtual": false}]}, {"name": "Capacity Utilization", "title": "Capacity Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "capacityUtilization", "datapointName": "capacityUtilization", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilization", "color": "orange2", "datapointName": "capacityUtilization", "isVirtual": false}]}, {"name": "Condition", "title": "Condition", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "condition", "datapointName": "condition", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Condition Status", "color": "silver", "datapointName": "condition", "isVirtual": false}]}, {"name": "Error Condition", "title": "Error Condition", "verticalLabel": "status code", "min": 0.0, "max": 16.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "errorCondition", "datapointName": "errorCondition", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Error Condition Status", "color": "red", "datapointName": "errorCondition", "isVirtual": false}]}, {"name": "Hot-Pluggable", "title": "Hot-Pluggable", "verticalLabel": "status code", "min": 0.0, "max": 4.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "hotPluggable", "datapointName": "hotPluggable", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Hot Pluggable Status", "color": "green", "datapointName": "hotPluggable", "isVirtual": false}]}, {"name": "Operating Status", "title": "Operating Status", "verticalLabel": "status code", "min": 0.0, "max": 18.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "status", "datapointName": "status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "blue", "datapointName": "status", "isVirtual": false}]}, {"name": "Redundancy", "title": "Redundancy", "verticalLabel": "status code", "min": 0.0, "max": 4.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "redundancy", "datapointName": "redundancy", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Redundancy Status", "color": "fuchsia", "datapointName": "redundancy", "isVirtual": false}]}, {"name": "Voltage", "title": "Voltage", "verticalLabel": "volts", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "mainVoltage", "datapointName": "mainVoltage", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Voltage", "color": "yellow", "datapointName": "mainVoltage", "isVirtual": false}]}], "overviewGraphs": [{"name": "Operating Status Overview", "title": "Operating Status Overview", "verticalLabel": "status code", "min": 0.0, "max": 18.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "status", "datapointName": "status", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "status", "isVirtual": false}]}]}

×DataSource: HP_Chassis_TemperatureSensors (1582)

{"name": "HP_Chassis_TemperatureSensors", "description": "Monitors various system temperature sensors readings and operating conditions.", "appliesTo": "system.sysinfo =~ \"Integrated Lights-Out\"", "searchKeywords": "hp,temperature,sensor,chassis,ilo,hardware", "displayedAs": "Temperature Sensors", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get(\"system.hostname\")\n\n// gather all properties necessary.\ndef props = hostProps.toProperties()\ndef timeout = 5000 // Timeout in milliseconds\n\nMap locationKey_map =\n [\n '1' : 'Other',\n '2' : 'Unknown',\n '3' : 'System',\n '4' : 'System Board',\n '5' : 'IO Board',\n '6' : 'CPU',\n '7' : 'Memory',\n '8' : 'Storage',\n '9' : 'Removable Media',\n '10': 'Power Supply',\n '11': 'Ambient',\n '12': 'Chassis',\n '13': 'Bridge Card'\n ]\n\ntry {\n def sensorLocation_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.6.2.6.8.1.3\", props, timeout)\n\n sensorLocation_WalkAsMap.each\n { key, val ->\n\n def (chassis, index) = key.toString().split(/\\./)\n\n println \"${key}##${locationKey_map[val]} Sensor ${index}######\" +\n \"auto.sensor.location=${locationKey_map[val]}&\" +\n \"auto.sensor.chassis=${chassis}\"\n }\n\n // Successful script execution, return 0;\n return 0\n}\ncatch (Exception e) {\n println e\n return 1\n}\n"}, "groupMethod": "ilp", "groupExpr": "auto.sensor.location"}, "datapoints": [{"name": "temperatureCelsius", "description": "Current temperature sensor reading, in degrees celsius.", "config": {"oid": "1.3.6.1.4.1.232.6.2.6.8.1.4.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "temperatureCondition", "description": "Sensor condition.\n\nStatus Codes:\n1=Other - cannot determine temperature, \n2=Ok - within normal operating range, \n3=Degraded - temperature readings are outside normal operating range, \n4=Failed - sensor detects a condition that could permanently damage the system. The system will automatically shutdown if the failed condition results, so it is unlikely that this value will ever be returned by the agent.", "config": {"oid": "1.3.6.1.4.1.232.6.2.6.8.1.6.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "threshold": "> 2 3", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "##INSTANCE## on HP host ##HOST## is reporting an operating condition status of ##VALUE##, placing the module into ##LEVEL## state.\n\nStatus Codes:\n1=Other - cannot determine temperature, \n2=Ok - within normal operating range, \n3=Degraded - temperature readings are outside normal operating range, \n4=Failed - sensor detects a condition that could permanently damage the system. The system will automatically shutdown if the failed condition results, so it is unlikely that this value will ever be returned by the agent.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "temperatureThreshold", "description": "This is the shutdown threshold temperature sensor setting in degrees Celsius. This is the temperature in which the sensor will be considered to be in a failed state thus causing the system to be shutdown.", "config": {"oid": "1.3.6.1.4.1.232.6.2.6.8.1.5.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Condition", "title": "Condition", "verticalLabel": "status", "min": 0.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "temperatureCondition", "datapointName": "temperatureCondition", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "fuchsia", "datapointName": "temperatureCondition", "isVirtual": false}]}, {"name": "Temperature", "title": "Temperature", "verticalLabel": "\u00b0C", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "temperatureCelsius", "datapointName": "temperatureCelsius", "consolidationFn": "average"}, {"name": "temperatureThreshold", "datapointName": "temperatureThreshold", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Current Temperature", "color": "orange2", "datapointName": "temperatureCelsius", "isVirtual": false}, {"type": "line", "legend": "Threshold", "color": "gray", "datapointName": "temperatureThreshold", "isVirtual": false}]}], "overviewGraphs": [{"name": "Sensor Condition Overview", "title": "Sensor Condition Overview", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "temperatureCondition", "datapointName": "temperatureCondition", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "temperatureCondition", "isVirtual": false}]}, {"name": "Top 10 Sensors by Temperature", "title": "Top 10 Sensors by Temperature", "verticalLabel": "\u00b0C", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "temperatureCelsius", "datapointName": "temperatureCelsius", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "temperatureCelsius", "isVirtual": false}]}]}

×DataSource: HP_System_ArrayController (1581)

{"name": "HP_System_ArrayController", "description": "Monitors various array controller operating parameters such as overall conditions and status.", "appliesTo": "system.sysinfo =~ \"Integrated Lights-Out\"", "searchKeywords": "controller,hp,array controller,ilo,hardware", "displayedAs": "Array Controller", "collectionInterval": "4m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get(\"system.hostname\")\n\n// gather all properties necessary.\ndef props = hostProps.toProperties()\ndef timeout = 5000 // Timeout in milliseconds\n\nMap model_key =\n [\n '1' : 'other',\n '2' : 'ida',\n '3' : 'idaExpansion',\n '4' : 'ida-2',\n '5' : 'smart',\n '6' : 'smart-2e',\n '7' : 'smart-2p',\n '8' : 'smart-2sl',\n '9' : 'smart-3100es',\n '10': 'smart-3200',\n '11': 'smart-2dh',\n '12': 'smart-221',\n '13': 'sa-4250es',\n '14': 'sa-4200',\n '15': 'sa-integrated',\n '16': 'sa-431',\n '17': 'sa-5300',\n '18': 'raidLc2',\n '19': 'sa-5i',\n '20': 'sa-532',\n '21': 'sa-5312',\n '22': 'sa-641',\n '23': 'sa-642',\n '24': 'sa-6400',\n '25': 'sa-6400em',\n '26': 'sa-6i',\n '27': 'sa-generic',\n '29': 'sa-p600',\n '30': 'sa-p400',\n '31': 'sa-e200',\n '32': 'sa-e200i',\n '33': 'sa-p400i',\n '34': 'sa-p800',\n '35': 'sa-e500',\n '36': 'sa-p700m',\n '37': 'sa-p212',\n '38': 'sa-p410',\n '39': 'sa-p410i',\n '40': 'sa-p411',\n '41': 'sa-b110i',\n '42': 'sa-p712m',\n '43': 'sa-p711m',\n '44': 'sa-p812',\n '45': 'sw-1210m',\n '46': 'sa-p220i',\n '47': 'sa-p222',\n '48': 'sa-p420',\n '49': 'sa-p420i',\n '50': 'sa-p421',\n '51': 'sa-b320i',\n '52': 'sa-p822',\n '53': 'sa-p721m',\n '54': 'sa-b120i',\n '55': 'hps-1224',\n '56': 'hps-1228',\n '57': 'hps-1228m',\n '58': 'sa-p822se',\n '59': 'hps-1224e',\n '60': 'hps-1228e',\n '61': 'hps-1228em',\n '62': 'sa-p230i',\n '63': 'sa-p430i',\n '64': 'sa-p430',\n '65': 'sa-p431',\n '66': 'sa-p731m',\n '67': 'sa-p830i',\n '68': 'sa-p830',\n '69': 'sa-p831',\n '70': 'sa-p530',\n '71': 'sa-p531',\n '72': 'sa-p244br',\n '73': 'sa-p246br',\n '74': 'sa-p440',\n '75': 'sa-p440ar',\n '76': 'sa-p441',\n '77': 'sa-p741m',\n '78': 'sa-p840',\n '79': 'sa-p841',\n '80': 'sh-h240ar',\n '81': 'sh-h244br',\n '82': 'sh-h240',\n '83': 'sh-h241',\n '84': 'sa-b140i',\n '85': 'sh-generic'\n ]\n\ntry {\n def controllerModel_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.2.1.1.2\", props, timeout)\n def controlleFirmware_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.2.1.1.3\", props, timeout)\n def controlleRevision_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.2.1.1.7\", props, timeout)\n def controllerSerialNumber_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.2.1.1.15\", props, timeout)\n\n controllerModel_WalkAsMap.each\n { index, model ->\n\n model_name = model_key[model].toString().toUpperCase()\n\n println \"${index}##Controller ${index} : ${model_name}######\" +\n \"auto.controller.model=${model_name}&\" +\n \"auto.controller.firmware=${controlleFirmware_WalkAsMap[index]}&\" +\n \"auto.controller.product_revision=${controlleRevision_WalkAsMap[index]}&\" +\n \"auto.controller.serial_number=${controllerSerialNumber_WalkAsMap[index]}\"\n }\n\n // Successful script execution, return 0;\n return 0\n}\ncatch (Exception e) {\n println e\n return 1\n}\n"}, "groupMethod": "none"}, "datapoints": [{"name": "ASICEncryptionSelfTestStatus", "description": "ASIC Encryption self-test status.\n\nStatus Codes:\n1=Other,\n2=Passed,\n3=Failed - ASIC encryption self test failed meaning the controller is not encrypted.", "config": {"oid": "1.3.6.1.4.1.232.3.2.2.1.1.35.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BoardCondition", "description": "Condition of controller & cache.\n\nStatus Codes:\n1=Other, \n2=Ok, \n3=Degraded, \n4=Failure", "config": {"oid": "1.3.6.1.4.1.232.3.2.2.1.1.12.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BoardStatus", "description": "Overall controller board status.\n\nStatus Codes:\n1=Other, \n2=Ok, \n3=General Failure, \n4=Cable Problem - check all cable connections to the controller, \n5=Powered Off, \n6=Cache Module Missing - operating without a cache module which is an unsupported configuration. Please install a cache module to the controller.", "config": {"oid": "1.3.6.1.4.1.232.3.2.2.1.1.10.##wildvalue##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "6", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Health", "description": "Overall condition of this controller, and any associated logical drives, physical drives, and cache modules.\n\nStatus Codes:\n1=Other, \n2=Ok, \n3=Degraded, \n4=Failure", "config": {"oid": "1.3.6.1.4.1.232.3.2.2.1.1.6.##wildvalue##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "threshold": "> 2 3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "##INSTANCE## on HP host ##HOST## is no longer in a healthy operating state and is reporting a status code of ##VALUE##, placing the array controller into ##LEVEL## state.\n\nStatus Codes:\n1=Other, \n2=Ok, \n3=Degraded, \n4=Failure\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "PartnerBoardCondition", "description": "Condition of controller & cache on the partner.\n\nStatus Codes:\n1=Other, \n2=Ok, \n3=Degraded, \n4=Failure", "config": {"oid": "1.3.6.1.4.1.232.3.2.2.1.1.13.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PartnerBoardStatus", "description": "Overall partner controller board status.\n\nStatus Codes:\n1=Other, \n2=Ok, \n3=General Failure, \n4=Cable Problem - check all cable connections to the controller, \n5=Powered Off, \n6=Cache Module Missing - operating without a cache module which is an unsupported configuration. Please install a cache module to the controller.", "config": {"oid": "1.3.6.1.4.1.232.3.2.2.1.1.11.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "6", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RedundancyError", "description": "Controller redundancy error status.\n\nStatus Codes:\n1=Other - cannot recognize, \n2=No Failures, \n3=No Redundant Controller Installed, \n4=Different Hardware - other controller is a different hardware model,\n5=No Link - inter-controller link to the other controller could not be established,\n6=Different Firmware - other controller has different firmware version,\n7=Different Cache - other controller has different cache size,\n8=Other Controller Cache Failure,\n9=No Drives - local controller cannot see drives while the other controller can,\n10=Other No Drives - local controller sees drives while the other controller cannot,\n11=Unsupported Drives - One or more attached drives has been determined to be incapable of properly supporting redundant controller operation,\n12=Expand In-Progress", "config": {"oid": "1.3.6.1.4.1.232.3.2.2.1.1.17.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "12", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cspNVRAMStatus", "description": "Critical Security Parameter (CSP) NVRAM status.\n\nStatus Codes:\n1=Other,\n2=Ok,\n3=Detected CSP Failure", "config": {"oid": "1.3.6.1.4.1.232.3.2.2.1.1.36.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "encryptionStatus", "description": "Controller encryption status.\n\nStatus Codes:\n1=Other,\n2=Not Enabled,\n3=Enabled Local Key,\n4=Enabled Remote Key Manager Mode", "config": {"oid": "1.3.6.1.4.1.232.3.2.2.1.1.34.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "ASIC Encryption Self-Test Status", "title": "ASIC Encryption Self-Test Status", "verticalLabel": "status code", "min": 0.0, "max": 4.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ASICEncryptionSelfTestStatus", "datapointName": "ASICEncryptionSelfTestStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "ASIC Encryption Self-Test", "color": "yellow", "datapointName": "ASICEncryptionSelfTestStatus", "isVirtual": false}]}, {"name": "CSP NVRAM Status", "title": "CSP NVRAM Status", "verticalLabel": "status code", "min": 0.0, "max": 4.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cspNVRAMStatus", "datapointName": "cspNVRAMStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "CSP NVRAM Status", "color": "gray", "datapointName": "cspNVRAMStatus", "isVirtual": false}]}, {"name": "Condition", "title": "Condition", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BoardCondition", "datapointName": "BoardCondition", "consolidationFn": "average"}, {"name": "Condition", "datapointName": "Health", "consolidationFn": "average"}, {"name": "PartnerBoardCondition", "datapointName": "PartnerBoardCondition", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Board Condition", "color": "aqua", "datapointName": "BoardCondition", "isVirtual": false}, {"type": "line", "legend": "Overall Condition", "color": "lime", "datapointName": "Condition", "isVirtual": false}, {"type": "line", "legend": "Partner Board Condition", "color": "silver", "datapointName": "PartnerBoardCondition", "isVirtual": false}]}, {"name": "Encryption Status", "title": "Encryption Status", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "encryptionStatus", "datapointName": "encryptionStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Encryption Status", "color": "fuchsia", "datapointName": "encryptionStatus", "isVirtual": false}]}, {"name": "Operating Status", "title": "Operating Status", "verticalLabel": "status code", "min": 0.0, "max": 7.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BoardStatus", "datapointName": "BoardStatus", "consolidationFn": "average"}, {"name": "PartnerBoardStatus", "datapointName": "PartnerBoardStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Board Status", "color": "aqua", "datapointName": "BoardStatus", "isVirtual": false}, {"type": "line", "legend": "Partner Board Status", "color": "silver", "datapointName": "PartnerBoardStatus", "isVirtual": false}]}, {"name": "Redundancy Error State", "title": "Redundancy Error State", "verticalLabel": "status code", "min": 0.0, "max": 13.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "RedundancyError", "datapointName": "RedundancyError", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Redundancy Error State", "color": "red", "datapointName": "RedundancyError", "isVirtual": false}]}]}

×DataSource: HP_System_CPU (1461)

{"name": "HP_System_CPU", "description": "Monitors the system CPU operating status, cache status, cache size and speed.", "appliesTo": "system.sysinfo =~ \"Integrated Lights-Out\"", "searchKeywords": "hp,cpu,ilo,hardware", "displayedAs": "CPU", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get(\"system.hostname\")\n\n// gather all properties necessary.\ndef props = hostProps.toProperties()\ndef timeout = 5000 // Timeout in milliseconds\n\ntry {\n def cpuSlot_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.1.2.2.1.1.1\", props, timeout)\n def cpuName_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.1.2.2.1.1.3\", props, timeout)\n\n cpuName_WalkAsMap.each\n { index, name ->\n\n println \"${index}##${name} : Slot ${cpuSlot_WalkAsMap[index]}\"\n }\n\n // Successful script execution, return 0;\n return 0\n}\ncatch (Exception e) {\n println e\n return 1\n}\n"}, "groupMethod": "none"}, "datapoints": [{"name": "L1CacheSize", "description": "L1 cache size, in kb.", "config": {"oid": ".1.3.6.1.4.1.232.1.2.2.3.1.3.##WILDVALUE##.1"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "L1CacheStatus", "description": "Cache status.\n\nStatus codes:\n1=Unknown,\n2=Ok,\n3=Degraded,\n4=Failed", "config": {"oid": ".1.3.6.1.4.1.232.1.2.2.3.1.5.##WILDVALUE##.1"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "L2CacheSize", "description": "L2 cache size, in kb.", "config": {"oid": ".1.3.6.1.4.1.232.1.2.2.3.1.3.##WILDVALUE##.2"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "L2CacheStatus", "description": "Cache status.\n\nStatus codes:\n1=Unknown,\n2=Ok,\n3=Degraded,\n4=Failed", "config": {"oid": ".1.3.6.1.4.1.232.1.2.2.3.1.5.##WILDVALUE##.2"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "L3CacheSize", "description": "L3 cache size, in kb.", "config": {"oid": ".1.3.6.1.4.1.232.1.2.2.3.1.3.##WILDVALUE##.3"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "L3CacheStatus", "description": "Cache status.\n\nStatus codes:\n1=Unknown,\n2=Ok,\n3=Degraded,\n4=Failed", "config": {"oid": ".1.3.6.1.4.1.232.1.2.2.3.1.5.##WILDVALUE##.3"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Speed", "description": "Processor speed, in megahertz.", "config": {"oid": ".1.3.6.1.4.1.232.1.2.2.1.1.4.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Status", "description": "Processor operating status.\n\nStatus codes:\n1=Unknown,\n2=Ok,\n3=Degraded,\n4=Failed,\n5=Disabled", "config": {"oid": ".1.3.6.1.4.1.232.1.2.2.1.1.6.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "5", "threshold": "= 3 4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "CPU ##INSTANCE## on HP host ##HOST## is no longer its optimal operating state and has reported a status of ##VALUE##, placing the module into ##LEVEL## state.\n\nStatus codes:\n1=Unknown,\n2=Ok,\n3=Degraded,\n4=Failed,\n5=Disabled\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "maxSpeed", "description": "Max processor speed, in megahertz.", "config": {"oid": ".1.3.6.1.4.1.232.1.2.2.1.1.21.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "CPU Speed", "title": "CPU Speed", "verticalLabel": "Ghz", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Speed", "datapointName": "Speed", "consolidationFn": "average"}, {"name": "maxSpeed", "datapointName": "maxSpeed", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "maxSpeed_ghz", "expr": "maxSpeed / 1000"}, {"name": "speed_ghz", "expr": "Speed / 1000"}], "lines": [{"type": "line", "legend": "Max Speed", "color": "black", "datapointName": "maxSpeed_ghz", "isVirtual": true}, {"type": "line", "legend": "Current Speed", "color": "orange", "datapointName": "speed_ghz", "isVirtual": true}]}, {"name": "Cache Size", "title": "Cache Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "L1CacheSize", "datapointName": "L1CacheSize", "consolidationFn": "average"}, {"name": "L2CacheSize", "datapointName": "L2CacheSize", "consolidationFn": "average"}, {"name": "L3CacheSize", "datapointName": "L3CacheSize", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "L1_bytes", "expr": "L1CacheSize * 1024"}, {"name": "L2_bytes", "expr": "L2CacheSize * 1024"}, {"name": "L3_bytes", "expr": "L3CacheSize * 1024"}], "lines": [{"type": "line", "legend": "L1", "color": "olive", "datapointName": "L1_bytes", "isVirtual": true}, {"type": "line", "legend": "L2", "color": "blue", "datapointName": "L2_bytes", "isVirtual": true}, {"type": "line", "legend": "L3", "color": "fuchsia", "datapointName": "L3_bytes", "isVirtual": true}]}, {"name": "Cache Status", "title": "Cache Status", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "L1CacheStatus", "datapointName": "L1CacheStatus", "consolidationFn": "average"}, {"name": "L2CacheStatus", "datapointName": "L2CacheStatus", "consolidationFn": "average"}, {"name": "L3CacheStatus", "datapointName": "L3CacheStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "L1", "color": "olive", "datapointName": "L1CacheStatus", "isVirtual": false}, {"type": "line", "legend": "L2", "color": "blue", "datapointName": "L2CacheStatus", "isVirtual": false}, {"type": "line", "legend": "L3", "color": "fuchsia", "datapointName": "L3CacheStatus", "isVirtual": false}]}, {"name": "Operating Status", "title": "Operating Status", "verticalLabel": "status code", "min": 0.0, "max": 6.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "silver", "datapointName": "Status", "isVirtual": false}]}]}

×DataSource: HP_System_LogicalDrives (1580)

{"name": "HP_System_LogicalDrives", "description": "Monitors system logical drive operating status, condition, rebuild progress and storage.", "appliesTo": "system.sysinfo =~ \"Integrated Lights-Out\"", "searchKeywords": "hp,drive,ilo,logical drives", "displayedAs": "Logical Drives", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get(\"system.hostname\")\n\n// gather all properties necessary.\ndef props = hostProps.toProperties()\ndef timeout = 5000 // Timeout in milliseconds\n\ntry {\n def driveID_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.3.1.1.10\", props, timeout)\n def driveStripeSize_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.3.1.1.13\", props, timeout)\n def driveOSName_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.3.1.1.14\", props, timeout)\n\n driveOSName_WalkAsMap.each\n { instance_index, osName ->\n\n def (controller_index, drive_index) = instance_index.toString().split(/\\./)\n\n println \"${instance_index}##Controller ${controller_index} : Logical Drive ${drive_index}##${osName}####\" +\n \"auto.logical_drive.os_name=${osName}&\" +\n \"auto.logical_drive.id=${driveID_WalkAsMap[instance_index]}&\" +\n \"auto.logical_drive.stripe_size=${driveStripeSize_WalkAsMap[instance_index]}\"\n }\n\n // Successful script execution, return 0;\n return 0\n}\ncatch (Exception e) {\n println e\n return 1\n}\n"}, "groupMethod": "none"}, "datapoints": [{"name": "Condition", "description": "Current health condition of the logical drive.\n\nStatus Codes:\n1=Other,\n2=Ok,\n3=Degraded,\n4=Failed", "config": {"oid": ".1.3.6.1.4.1.232.3.2.3.1.1.11.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "threshold": "> 2 3", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "##INSTANCE## (##DSIDESCRIPTION##) on HP host ##HOST## is no longer its optimal health condition and is reporting a status code of ##VALUE##, placing it into ##LEVEL## state.\n\nStatus Codes:\n1=Other,\n2=Ok,\n3=Degraded,\n4=Failed\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "Status", "description": "Drive operating status.\n\nStatus Code:\n1=Other,\n2=Ok,\n3=Failed,\n4=Unconfigured,\n5=Recovering,\n6=Ready For Rebuild,\n7=Rebuilding,\n8=Wrong Drive,\n9=Bad Connect,\n10=Over Heating,\n11=Shutdown,\n12=Expanding,\n13=Not Available,\n14=Queued for Expansion,\n15=Multi-path Access Degraded,\n16=Erasing,\n17=Predictive Spare Rebuild Ready,\n18=Rapid Parity Initialization In-Progress,\n19=Rapid Parity Initialization Pending,\n20=No Access - Encrypted with No Controller Key,\n21=Unencrypted to Encrypted Transformation in Progress,\n22=New Logical Drive Key Rekey in Progress,\n23=No Access - Encrypted with Controller Encryption Not Enabled,\n24=Unencrypted To Encrypted Transformation Not Started,\n25=New Logical Drive Key Rekey Request Received", "config": {"oid": ".1.3.6.1.4.1.232.3.2.3.1.1.4.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "25", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "faultTolerance", "description": "Fault Tolerance mode.\n\nStatus Codes:\n1=Other,\n2=None,\n3=Mirroring RAID 1,\n4=Data Guard RAID 4,\n5=Distributed Data Guard RAID 5,\n7=Advanced Data Guarding RAID 6,\n8=RAID 50,\n9=RAID 60,\n10=RAID 1 ADM,\n11=RAID 10 ADM", "config": {"oid": ".1.3.6.1.4.1.232.3.2.3.1.1.3.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "11", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "percentRebuild", "description": "Percentage of logical drive rebuilt.", "config": {"oid": ".1.3.6.1.4.1.232.3.2.3.1.1.12.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rebuildBlocksRemaining", "description": "Logical drive rebuild blocks remaining.", "config": {"oid": ".1.3.6.1.4.1.232.3.2.3.1.1.6.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "size", "description": "Logical drive size, in bytes.", "config": {}, "interpretMethod": "expression", "interpretExpr": "size_mb * 1024 * 1024", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "size_mb", "description": "Logical drive size, in megabytes.", "config": {"oid": ".1.3.6.1.4.1.232.3.2.3.1.1.9.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "statusAlertError", "description": "Drive operating status.\n\nStatus Code:\n1=Other,\n2=Ok,\n3=Failed,\n4=Unconfigured,\n5=Recovering,\n6=Ready For Rebuild,\n7=Rebuilding,\n8=Wrong Drive,\n9=Bad Connect,\n10=Over Heating,\n11=Shutdown,\n12=Expanding,\n13=Not Available,\n14=Queued for Expansion,\n15=Multi-path Access Degraded,\n16=Erasing,\n17=Predictive Spare Rebuild Ready,\n18=Rapid Parity Initialization In-Progress,\n19=Rapid Parity Initialization Pending,\n20=No Access - Encrypted with No Controller Key,\n21=Unencrypted to Encrypted Transformation in Progress,\n22=New Logical Drive Key Rekey in Progress,\n23=No Access - Encrypted with Controller Encryption Not Enabled,\n24=Unencrypted To Encrypted Transformation Not Started,\n25=New Logical Drive Key Rekey Request Received", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(in(3,5,9,10,Status),Status,0)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 0 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## (##DSIDESCRIPTION##) on HP host ##HOST## is no longer operating optimally and is reporting a status code of ##VALUE##, placing it into ##LEVEL## state.\n\nStatus Code:\n1=Other,\n2=Ok,\n3=Failed,\n4=Unconfigured,\n5=Recovering,\n6=Ready For Rebuild,\n7=Rebuilding,\n8=Wrong Drive,\n9=Bad Connect,\n10=Over Heating,\n11=Shutdown,\n12=Expanding,\n13=Not Available,\n14=Queued for Expansion,\n15=Multi-path Access Degraded,\n16=Erasing,\n17=Predictive Spare Rebuild Ready,\n18=Rapid Parity Initialization In-Progress,\n19=Rapid Parity Initialization Pending,\n20=No Access - Encrypted with No Controller Key,\n21=Unencrypted to Encrypted Transformation in Progress,\n22=New Logical Drive Key Rekey in Progress,\n23=No Access - Encrypted with Controller Encryption Not Enabled,\n24=Unencrypted To Encrypted Transformation Not Started,\n25=New Logical Drive Key Rekey Request Received\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "statusAlertWarning", "description": "Drive operating status.\n\nStatus Code:\n1=Other,\n2=Ok,\n3=Failed,\n4=Unconfigured,\n5=Recovering,\n6=Ready For Rebuild,\n7=Rebuilding,\n8=Wrong Drive,\n9=Bad Connect,\n10=Over Heating,\n11=Shutdown,\n12=Expanding,\n13=Not Available,\n14=Queued for Expansion,\n15=Multi-path Access Degraded,\n16=Erasing,\n17=Predictive Spare Rebuild Ready,\n18=Rapid Parity Initialization In-Progress,\n19=Rapid Parity Initialization Pending,\n20=No Access - Encrypted with No Controller Key,\n21=Unencrypted to Encrypted Transformation in Progress,\n22=New Logical Drive Key Rekey in Progress,\n23=No Access - Encrypted with Controller Encryption Not Enabled,\n24=Unencrypted To Encrypted Transformation Not Started,\n25=New Logical Drive Key Rekey Request Received", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(in(4,8,13,15,16,20,23,Status),Status,0)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## (##DSIDESCRIPTION##) on HP host ##HOST## is no longer operating optimally and is reporting a status code of ##VALUE##, placing it into ##LEVEL## state.\n\nStatus Code:\n1=Other,\n2=Ok,\n3=Failed,\n4=Unconfigured,\n5=Recovering,\n6=Ready For Rebuild,\n7=Rebuilding,\n8=Wrong Drive,\n9=Bad Connect,\n10=Over Heating,\n11=Shutdown,\n12=Expanding,\n13=Not Available,\n14=Queued for Expansion,\n15=Multi-path Access Degraded,\n16=Erasing,\n17=Predictive Spare Rebuild Ready,\n18=Rapid Parity Initialization In-Progress,\n19=Rapid Parity Initialization Pending,\n20=No Access - Encrypted with No Controller Key,\n21=Unencrypted to Encrypted Transformation in Progress,\n22=New Logical Drive Key Rekey in Progress,\n23=No Access - Encrypted with Controller Encryption Not Enabled,\n24=Unencrypted To Encrypted Transformation Not Started,\n25=New Logical Drive Key Rekey Request Received\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Fault Tolerance", "title": "Fault Tolerance", "verticalLabel": "status code", "min": 0.0, "max": 12.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "faultTolerance", "datapointName": "faultTolerance", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Fault Tolerance", "color": "gray", "datapointName": "faultTolerance", "isVirtual": false}]}, {"name": "Health State", "title": "Health State", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Condition", "datapointName": "Condition", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Health", "color": "olive", "datapointName": "Condition", "isVirtual": false}]}, {"name": "Operating Status", "title": "Operating Status", "verticalLabel": "status code", "min": 0.0, "max": 26.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Status", "color": "silver", "datapointName": "Status", "isVirtual": false}]}, {"name": "Rebuild Blocks Remaining", "title": "Rebuild Blocks Remaining", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "rebuildBlocksRemaining", "datapointName": "rebuildBlocksRemaining", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Block Remaining", "color": "fuchsia", "datapointName": "rebuildBlocksRemaining", "isVirtual": false}]}, {"name": "Rebuild Progress", "title": "Rebuild Progress", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "percentRebuild", "datapointName": "percentRebuild", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Percent Rebuilt", "color": "orange2", "datapointName": "percentRebuild", "isVirtual": false}]}, {"name": "Storage", "title": "Storage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "size", "datapointName": "size", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Size", "color": "maroon", "datapointName": "size", "isVirtual": false}]}], "overviewGraphs": [{"name": "Logical Drive Health Overview", "title": "Logical Drive Health Overview", "verticalLabel": "2=ok", "min": 0.0, "max": 5.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Condition", "datapointName": "Condition", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "Condition", "isVirtual": false}]}]}

×DataSource: HP_System_NICAdapter (1579)

{"name": "HP_System_NICAdapter", "description": "Monitors physical network adapter operating state, throughput, etc.", "appliesTo": "system.sysinfo =~ \"Integrated Lights-Out\"", "searchKeywords": "hp,nic,ilo,network", "displayedAs": "NIC Adapter", "collectionInterval": "2m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get(\"system.hostname\")\n\n// gather all properties necessary.\ndef props = hostProps.toProperties()\ndef timeout = 5000 // Timeout in milliseconds\n\ntry {\n def adapterMacAddr_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.18.2.3.1.1.4\", props, timeout)\n def adapterLocation_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.18.2.3.1.1.31\", props, timeout)\n def adapterPartNumber_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.18.2.3.1.1.32\", props, timeout)\n def adapterName_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.18.2.3.1.1.39\", props, timeout)\n def adapterFirmware_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.18.2.3.1.1.41\", props, timeout)\n\n adapterMacAddr_WalkAsMap.each\n { index, macAddr ->\n\n println \"${index}##${adapterName_WalkAsMap[index]} - ${index}##${macAddr}####\" +\n \"auto.adapter.name=${adapterName_WalkAsMap[index]}&\" +\n \"auto.adapter.mac_address=${macAddr}&\" +\n \"auto.adapter.location=${adapterLocation_WalkAsMap[index]}&\" +\n \"auto.adapter.part_number=${adapterPartNumber_WalkAsMap[index]}&\" +\n \"auto.adapter.firmware=${adapterFirmware_WalkAsMap[index]}\"\n }\n\n // Successful script execution, return 0;\n return 0\n}\ncatch (Exception e) {\n println e\n return 1\n}\n"}, "groupMethod": "regex", "groupExpr": "dynamicGroup=\".*\\s+(\\d+Gb)\\s+.*\""}, "datapoints": [{"name": "badFramesReceived", "description": "Received frames per second with errors.", "config": {"oid": ".1.3.6.1.4.1.232.18.2.3.1.1.19.##WILDVALUE##"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "badFramesTransmitted", "description": "Transmitted frames per second with errors.", "config": {"oid": ".1.3.6.1.4.1.232.18.2.3.1.1.18.##WILDVALUE##"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "bps_recieved", "description": "Amount of data received, in bits/sec.", "config": {}, "interpretMethod": "expression", "interpretExpr": "octetsRecieved / 8", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "bps_sent", "description": "Amount of data sent, in bits/sec.", "config": {}, "interpretMethod": "expression", "interpretExpr": "octetsSent / 8", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "health", "description": "Operating condition of the adapter.\n\nStatus Codes:\n1=Other,\n2=Ok,\n3=Degraded,\n4=Failed", "config": {"oid": ".1.3.6.1.4.1.232.18.2.3.1.1.12.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "threshold": "> 2 3", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "##INSTANCE## on HP host ##HOST## is no longer in a healthy state and has reported a status code of ##VALUE##, placing it into ##LEVEL## state.\n\nStatus Codes:\n1=Other,\n2=Ok,\n3=Degraded,\n4=Failed\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "octetsRecieved", "description": "Octets received per second.", "config": {"oid": ".1.3.6.1.4.1.232.18.2.3.1.1.37.##WILDVALUE##"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "octetsSent", "description": "Octets sent per second.", "config": {"oid": ".1.3.6.1.4.1.232.18.2.3.1.1.38.##WILDVALUE##"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operatingState", "description": "Operating state of the adapter.\n\nStatus Codes:\n1=Unknown,\n2=Active,\n3=Standby,\n4=Failed", "config": {"oid": ".1.3.6.1.4.1.232.18.2.3.1.1.13.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "threshold": "= 4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "##INSTANCE## on HP host ##HOST## has reported a failed operating state, placing it into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "operatingStatus", "description": "Operating status of the adapter.\n\nStatus Codes:\n1=Unknown,\n2=Ok,\n3=General Failure,\n4=Link Failure", "config": {"oid": ".1.3.6.1.4.1.232.18.2.3.1.1.14.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "threshold": "> 2 2", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "##INSTANCE## on HP host ##HOST## is no longer operating optimally and has reported a status code of ##VALUE##, placing it into ##LEVEL## state.\n\nStatus Codes:\n1=Unknown,\n2=Ok,\n3=General Failure,\n4=Link Failure\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "successfulFramesReceived", "description": "Successfully received frames, per second.", "config": {"oid": ".1.3.6.1.4.1.232.18.2.3.1.1.17.##WILDVALUE##"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "successfulFramesTransmitted", "description": "Successfully transmitted frames, per second.", "config": {"oid": ".1.3.6.1.4.1.232.18.2.3.1.1.16.##WILDVALUE##"}, "interpretMethod": "none", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Adapter Health", "title": "Adapter Health", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "health", "datapointName": "health", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Health Status", "color": "silver", "datapointName": "health", "isVirtual": false}]}, {"name": "Frame Transmission", "title": "Frame Transmission", "verticalLabel": "frames/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "badFramesReceived", "datapointName": "badFramesReceived", "consolidationFn": "average"}, {"name": "badFramesTransmitted", "datapointName": "badFramesTransmitted", "consolidationFn": "average"}, {"name": "successfulFramesReceived", "datapointName": "successfulFramesReceived", "consolidationFn": "average"}, {"name": "successfulFramesTransmitted", "datapointName": "successfulFramesTransmitted", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Failed Rx", "color": "orange2", "datapointName": "badFramesReceived", "isVirtual": false}, {"type": "stack", "legend": "Failed Tx", "color": "red", "datapointName": "badFramesTransmitted", "isVirtual": false}, {"type": "stack", "legend": "Successful Rx", "color": "aqua", "datapointName": "successfulFramesReceived", "isVirtual": false}, {"type": "stack", "legend": "Successful Tx", "color": "olive", "datapointName": "successfulFramesTransmitted", "isVirtual": false}]}, {"name": "Operating State", "title": "Operating State", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "operatingState", "datapointName": "operatingState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "State", "color": "gray", "datapointName": "operatingState", "isVirtual": false}]}, {"name": "Operating Status", "title": "Operating Status", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "operatingStatus", "datapointName": "operatingStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "fuchsia", "datapointName": "operatingStatus", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "bps_recieved", "datapointName": "bps_recieved", "consolidationFn": "average"}, {"name": "bps_sent", "datapointName": "bps_sent", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Recieved", "color": "blue", "datapointName": "bps_recieved", "isVirtual": false}, {"type": "stack", "legend": "Sent", "color": "olive", "datapointName": "bps_sent", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Adapters by Total Throughput", "title": "Top 10 Adapters by Total Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "bps_recieved", "datapointName": "bps_recieved", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "bps_sent", "datapointName": "bps_sent", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "total_bps", "expr": "bps_recieved + bps_sent"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "total_bps", "isVirtual": true}]}]}

×DataSource: HP_System_PhysicalDrives (1578)

{"name": "HP_System_PhysicalDrives", "description": "Monitors physical drive health condition, operating status, SMART status, storage, etc.", "appliesTo": "system.sysinfo =~ \"Integrated Lights-Out\"", "searchKeywords": "hp,hdd,physical drives,drive,ilo", "displayedAs": "Physical Drives", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get(\"system.hostname\")\n\n// gather all properties necessary.\ndef props = hostProps.toProperties()\ndef timeout = 5000 // Timeout in milliseconds\n\n\nMap driveType_key =\n [\n '1': 'Other',\n '2': 'HDD',\n '3': 'SSD'\n ]\n\nMap driveLocation_key =\n [\n '1': 'Other',\n '2': 'Internal',\n '3': 'External',\n '4': 'ProLiant'\n ]\n\ntry {\n def driveModel_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.5.1.1.3\", props, timeout)\n def driveFirmware_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.5.1.1.4\", props, timeout)\n def driveBay_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.5.1.1.5\", props, timeout)\n def driveLocation_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.5.1.1.44\", props, timeout)\n def driveBusNumber_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.5.1.1.50\", props, timeout)\n def driveSerialNumber_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.5.1.1.51\", props, timeout)\n def driveType_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.5.1.1.69\", props, timeout)\n\n driveBay_WalkAsMap.each\n { index, bay ->\n\n def (controller_index, drive_index) = index.toString().split(/\\./)\n\n println \"${index}##Controller ${controller_index} : Drive ${drive_index}##Bay: ${bay}####\" +\n \"auto.drive.model=${driveModel_WalkAsMap[index]}&\" +\n \"auto.drive.firmware=${driveFirmware_WalkAsMap[index]}&\" +\n \"auto.drive.location=${driveLocation_key[driveLocation_WalkAsMap[index]]}&\" +\n \"auto.drive.bus=${driveBusNumber_WalkAsMap[index]}&\" +\n \"auto.drive.serial_number=${driveSerialNumber_WalkAsMap[index]}&\" +\n \"auto.drive.type=${driveType_key[driveType_WalkAsMap[index]]}&\" +\n \"auto.drive.bay=${driveBay_WalkAsMap[index]}\"\n }\n\n // Successful script execution, return 0;\n return 0\n}\ncatch (Exception e) {\n println e\n return 1\n}\n"}, "groupMethod": "ilp", "groupExpr": "auto.drive.type"}, "datapoints": [{"name": "SMART_status", "description": "S.M.A.R.T. status of the drive.\n\nStatus Codes:\n1=Other, \n2=Ok, \n3=Replace - Indicates that the drive has a S.M.A.R.T predictive failure error and should be replaced., \n4=SSD Wear Out - Indicates that the solid state drive has a S.M.A.R.T wear error and is approaching the maximum usage limit for writes (wear out). The solid state drive should be replaced as soon as possible.", "config": {"oid": "1.3.6.1.4.1.232.3.2.5.1.1.57.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "threshold": "= 3", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "##INSTANCE## (##DSIDESCRIPTION##) on HP host ##HOST## has reported a SMART predictive failure, placing the drive into ##LEVEL## state.\n\nIt is recommended that the drive be replaced.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "capacity_MB", "description": "Physical drive capacity, in megabytes.", "config": {"oid": "1.3.6.1.4.1.232.3.2.5.1.1.45.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "capacity_bytes", "description": "Physical drive capacity, in bytes.", "config": {}, "interpretMethod": "expression", "interpretExpr": "capacity_MB * 1024 * 1024", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "condition", "description": "Condition status of the drive.\n\nStatus Codes:\n1=Other, \n2=Ok, \n3=Degraded,\n4=Failed", "config": {"oid": "1.3.6.1.4.1.232.3.2.5.1.1.37.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "threshold": "> 2 3", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## (##DSIDESCRIPTION##) on HP host ##HOST## is no longer in a healthy state and has reported a status of ##VALUE##, placing it into ##LEVEL## state.\n\nStatus Codes:\n1=Other, \n2=Ok, \n3=Degraded,\n4=Failed\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "hours_in_operation", "description": "Total number of hours the drive has been operational.", "config": {"oid": "1.3.6.1.4.1.232.3.2.5.1.1.9.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ssdWearStatus", "description": "Wear status of the SSD.\n\nStatus Codes:\n0=Not an SSD,\n1=Other, \n2=Ok, \n3=56 Day Threshold, \n4=5% remaining, \n5=2% remaining, \n6=Worn out", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(un(ssdWearStatusRaw),0,ssdWearStatusRaw)", "type": "gauge", "dataType": 7, "min": "0", "max": "6", "threshold": "> 2 3", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## (##DSIDESCRIPTION##) on HP host ##HOST## is nearing end of life, returning a status code of ##VALUE##, placing the drive into ##LEVEL## state.\n\nStatus Codes:\n0=Not an SSD,\n1=Other, \n2=Ok, \n3=56 Day Threshold, \n4=5% remaining, \n5=2% remaining, \n6=Worn out\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "ssdWearStatusRaw", "description": "Wear status of the SSD.\n\nStatus Codes:\n1=Other, \n2=Ok, \n3=56 Day Threshold, \n4=5% remaining, \n5=2% remaining, \n6=Worn out", "config": {"oid": "1.3.6.1.4.1.232.3.2.5.1.1.73.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "6", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "statusAlertError", "description": "Current drive status.\n\nStatus Codes:\n1=Other,\n2=Ok,\n3=Failed - no longer operational and should be replaced,\n4=Predictive Failure - has predictive failure and should be replaced,\n5=Erasing - currently in process of being erased,\n6=Erase Done - drive is erased and in offline state,\n7=Erase Queued - erase operation is in queue,\n8=SSD Wear Out - drive is approaching maximum usage limit for writes and should be replaced soon,\n9=Not Authenticated - Indicates the physical drive could not be authenticated as a genuine HP hard drive. The array controller will no longer control the drive LEDs. Please replace the hard drive with a genuine HP hard drive.", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(in(3,statusRaw),statusRaw,0)", "type": "gauge", "dataType": 7, "min": "0", "max": "9", "threshold": "!= 0 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## (##DSIDESCRIPTION##) on HP host ##HOST## is has failed and should be replaced, placing the drive into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "statusAlertWarning", "description": "Current drive status.\n\nStatus Codes:\n1=Other,\n2=Ok,\n3=Failed - no longer operational and should be replaced,\n4=Predictive Failure - has predictive failure and should be replaced,\n5=Erasing - currently in process of being erased,\n6=Erase Done - drive is erased and in offline state,\n7=Erase Queued - erase operation is in queue,\n8=SSD Wear Out - drive is approaching maximum usage limit for writes and should be replaced soon,\n9=Not Authenticated - Indicates the physical drive could not be authenticated as a genuine HP hard drive. The array controller will no longer control the drive LEDs. Please replace the hard drive with a genuine HP hard drive.", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(in(4,5,7,9,statusRaw),statusRaw,0)", "type": "gauge", "dataType": 7, "min": "0", "max": "9", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## (##DSIDESCRIPTION##) on HP host ##HOST## is no longer in an optimal operating state and has reported a status of ##VALUE##, placing the drive into ##LEVEL## state.\n\nStatus Codes:\n1=Other,\n2=Ok,\n3=Failed - no longer operational and should be replaced,\n4=Predictive Failure - has predictive failure and should be replaced,\n5=Erasing - currently in process of being erased,\n6=Erase Done - drive is erased and in offline state,\n7=Erase Queued - erase operation is in queue,\n8=SSD Wear Out - drive is approaching maximum usage limit for writes and should be replaced soon,\n9=Not Authenticated - Indicates the physical drive could not be authenticated as a genuine HP hard drive. The array controller will no longer control the drive LEDs. Please replace the hard drive with a genuine HP hard drive.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "statusRaw", "description": "Current drive status.\n\nStatus Codes:\n1=Other,\n2=Ok,\n3=Failed - no longer operational and should be replaced,\n4=Predictive Failure - has predictive failure and should be replaced,\n5=Erasing - currently in process of being erased,\n6=Erase Done - drive is erased and in offline state,\n7=Erase Queued - erase operation is in queue,\n8=SSD Wear Out - drive is approaching maximum usage limit for writes and should be replaced soon,\n9=Not Authenticated - Indicates the physical drive could not be authenticated as a genuine HP hard drive. The array controller will no longer control the drive LEDs. Please replace the hard drive with a genuine HP hard drive.", "config": {"oid": "1.3.6.1.4.1.232.3.2.5.1.1.6.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "9", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "temperatureAlert", "description": "Alerts if the current temperature reading reaches the threshold.", "config": {}, "interpretMethod": "expression", "interpretExpr": "if((gt(temperature_celsius,temperature_threshold) || eq(temperature_celsius,temperature_threshold)),temperature_celsius,0)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## (##DSIDESCRIPTION##) on HP host ##HOST## has reached ##VALUE## \u00b0C, surpassing its temperature threshold, placing the drive into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "temperature_celsius", "description": "Current temperature of the drive, in Celsius.", "config": {"oid": "1.3.6.1.4.1.232.3.2.5.1.1.70.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "temperature_maximum", "description": "Maximum temperature the drive has ever reached, in Celsius.", "config": {"oid": "1.3.6.1.4.1.232.3.2.5.1.1.72.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "temperature_threshold", "description": "Temperature threshold for the drive, in Celsius.", "config": {"oid": "1.3.6.1.4.1.232.3.2.5.1.1.71.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Drive Capacity", "title": "Drive Capacity", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "capacity_bytes", "datapointName": "capacity_bytes", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Capacity", "color": "purple", "datapointName": "capacity_bytes", "isVirtual": false}]}, {"name": "Drive Health", "title": "Drive Health", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "condition", "datapointName": "condition", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Health Condition", "color": "blue", "datapointName": "condition", "isVirtual": false}]}, {"name": "Hours In Operation", "title": "Hours In Operation", "verticalLabel": "hour(s)", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "hours_in_operation", "datapointName": "hours_in_operation", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Hours In Operation", "color": "maroon", "datapointName": "hours_in_operation", "isVirtual": false}]}, {"name": "Operating Status", "title": "Operating Status", "verticalLabel": "status code", "min": 0.0, "max": 10.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "statusRaw", "datapointName": "statusRaw", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Operating Status", "color": "navy", "datapointName": "statusRaw", "isVirtual": false}]}, {"name": "SMART Status", "title": "SMART Status", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SMART_status", "datapointName": "SMART_status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "SMART Status", "color": "green", "datapointName": "SMART_status", "isVirtual": false}]}, {"name": "SSD Wear Status", "title": "SSD Wear Status", "verticalLabel": "status code", "min": -1.0, "max": 7.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ssdWearStatus", "datapointName": "ssdWearStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "SSD Wear Status", "color": "fuchsia", "datapointName": "ssdWearStatus", "isVirtual": false}]}, {"name": "Temperature", "title": "Temperature", "verticalLabel": "\u00b0C", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "temperature_celsius", "datapointName": "temperature_celsius", "consolidationFn": "average"}, {"name": "temperature_maximum", "datapointName": "temperature_maximum", "consolidationFn": "average"}, {"name": "temperature_threshold", "datapointName": "temperature_threshold", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Current", "color": "orange2", "datapointName": "temperature_celsius", "isVirtual": false}, {"type": "line", "legend": "Maximum", "color": "red1", "datapointName": "temperature_maximum", "isVirtual": false}, {"type": "line", "legend": "Threshold", "color": "gray", "datapointName": "temperature_threshold", "isVirtual": false}]}], "overviewGraphs": [{"name": "Health Overview", "title": "Health Overview", "verticalLabel": "2=ok", "min": 0.0, "max": 5.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "condition", "datapointName": "condition", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "condition", "isVirtual": false}]}, {"name": "SMART Status Overview", "title": "SMART Status Overview", "verticalLabel": "2=ok", "min": 0.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "SMART_status", "datapointName": "SMART_status", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "SMART_status", "isVirtual": false}]}, {"name": "Top 10 Drives by Highest Temperature", "title": "Top 10 Drives by Highest Temperature", "verticalLabel": "\u00b0C", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "temperature_celsius", "datapointName": "temperature_celsius", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "temperature_celsius", "isVirtual": false}]}]}

×DataSource: HP_System_SpareDrives (1577)

{"name": "HP_System_SpareDrives", "description": "Monitors spare drive operating status, condition and rebuild.", "appliesTo": "system.sysinfo =~ \"Integrated Lights-Out\"", "searchKeywords": "spare drives,hp,drive,ilo", "displayedAs": "Spare Drives", "collectionInterval": "4m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get(\"system.hostname\")\n\n// gather all properties necessary.\ndef props = hostProps.toProperties()\ndef timeout = 5000 // Timeout in milliseconds\n\ntry {\n def driveLocation_WalkAsMap = Snmp.walkAsMap(hostname, \".1.3.6.1.4.1.232.3.2.4.1.1.12\", props, timeout)\n\n driveLocation_WalkAsMap.each\n { index, location ->\n\n def (controller_index, drive_index) = index.toString().split(/\\./)\n\n println \"${index}##Controller ${controller_index} : Spare Drive ${drive_index}##${location}\"\n }\n\n // Successful script execution, return 0;\n return 0\n}\ncatch (Exception e) {\n println e\n return 1\n}\n"}, "groupMethod": "none"}, "datapoints": [{"name": "Health", "description": "Health condition of the drive.\n\nStatus Codes:\n1=Other, \n2=Ok, \n3=Degraded,\n4=Failed", "config": {"oid": ".1.3.6.1.4.1.232.3.2.4.1.1.6.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "threshold": "> 2 3", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## (##DSIDESCRIPTION##) on HP host ##HOST## is no longer its optimal health state and has reported a status of ##VALUE##, placing the spare drive into ##LEVEL## state.\n\nStatus Codes:\n1=Other,\n2=Ok,\n3=Degraded,\n4=Failed\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "Status", "description": "Operating status of the on-line spare drive.\n\nStatus Codes:\n1=Other,\n2=Invalid,\n3=Failed - on-line spare has failed and is no longer available for use,\n4=Inactive - monitored system has an on-line spare configured, but is not currently in use,\n5=Building - physical drive has failed. Automatic Data Recovery is in progress to recover data to the on-line spare,\n6=Active - physical drive has failed. Automatic Data Recovery is complete. The system is using the on-line spare as a replacement for the failed drive.", "config": {"oid": ".1.3.6.1.4.1.232.3.2.4.1.1.3.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "6", "threshold": "= 3", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##INSTANCE## (##DSIDESCRIPTION##) on HP host ##HOST## is reporting a failed operating status, placing the spare drive into ##LEVEL## state.\n\nIf there are no available spares (or present spares have failed) then the RAID will not be able to rebuild. \n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "percentRebuild", "description": "Percent progress of spare drive rebuild.\n\n-1=Drive is not rebuilding", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(eq(Status,5),percentRebuildRaw,(1-2))", "type": "gauge", "dataType": 7, "min": "-1", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "percentRebuildRaw", "description": "If the spare status is building(5), then this is percent\ncomplete of of the rebuild.\nThe data contained on the failed physical drive must be\nreconstructed from the fault tolerance data and copied to the\nspare so that the spare can function in place of the failed drive.\nWhen the number reaches one hundred (100), the building process\nis complete and the spare has replaced the physical drive.\nIf the value cannot be determined or a rebuild is not active,\nthe value is set to 4,294,967,295.", "config": {"oid": ".1.3.6.1.4.1.232.3.2.4.1.1.11.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rebuildBlocksRemaining", "description": "Number of blocks left to rebuild before completion.", "config": {"oid": ".1.3.6.1.4.1.232.3.2.4.1.1.5.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Health State", "title": "Health State", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Health", "datapointName": "Health", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Health State", "color": "blue", "datapointName": "Health", "isVirtual": false}]}, {"name": "Operating Status", "title": "Operating Status", "verticalLabel": "status code", "min": 0.0, "max": 7.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "olive", "datapointName": "Status", "isVirtual": false}]}, {"name": "Rebuild Blocks Remaining", "title": "Rebuild Blocks Remaining", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "rebuildBlocksRemaining", "datapointName": "rebuildBlocksRemaining", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Blocks Remaining", "color": "orange2", "datapointName": "rebuildBlocksRemaining", "isVirtual": false}]}, {"name": "Rebuild Progress", "title": "Rebuild Progress", "verticalLabel": "%", "min": -1.0, "max": 100.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "percentRebuild", "datapointName": "percentRebuild", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Rebuild Progress", "color": "fuchsia", "datapointName": "percentRebuild", "isVirtual": false}]}], "overviewGraphs": [{"name": "Health Overview", "title": "Health Overview", "verticalLabel": "2=ok", "min": 0.0, "max": 5.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Health", "datapointName": "Health", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Health", "isVirtual": false}]}]}

×DataSource: Kubernetes_Healthz (1656)

{"name": "Kubernetes_Healthz", "description": "Monitors the outcome of a Kubernetes Health Check.", "appliesTo": "kubernetes.label.app == \"argus\"", "searchKeywords": "kubernetes,health,container orchestration", "technicalNotes": "https://github.com/logicmonitor/k8s-argus", "displayedAs": "Kubernetes Healthz", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.http.HTTP\nimport groovy.json.JsonSlurper\n\ndef env = System.getenv()\ndef kubernetes_service_host = env[\"KUBERNETES_SERVICE_HOST\"]\ndef kubernetes_service_port = env.get(\"KUBERNETES_SERVICE_PORT\")?.toInteger()?:443\ndef serviceaccount_token = new File('/var/run/secrets/kubernetes.io/serviceaccount/token').text\ndef request_headers = [\"Authorization\" : \"Bearer ${serviceaccount_token}\"]\n\ndef request_endpoint = \"https://${kubernetes_service_host}/\"\ndef http = HTTP.open( kubernetes_service_host, kubernetes_service_port)\n\nhttp.get( request_endpoint, request_headers )\n\ndef result = new JsonSlurper().parseText( http.getResponseBody() )\nresult.paths.each { String i ->\n if (i.contains(\"healthz\")) { println \"${i}##${i.tokenize(\"/\")[-1] }\" }\n}\n\nreturn 0\n"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.http.HTTP\nimport groovy.json.JsonSlurper\n\ndef env = System.getenv()\ndef kubernetes_service_host = env[\"KUBERNETES_SERVICE_HOST\"]\ndef kubernetes_service_port = env.get(\"KUBERNETES_SERVICE_PORT\")?.toInteger()?:443\ndef serviceaccount_token = new File('/var/run/secrets/kubernetes.io/serviceaccount/token').text\ndef request_headers = [\"Authorization\" : \"Bearer ${serviceaccount_token}\"]\n\ndef request_endpoint = \"https://${kubernetes_service_host}/\"\ndef http = HTTP.open( kubernetes_service_host, kubernetes_service_port)\n\nhttp.get( request_endpoint, request_headers )\n\ndef result = new JsonSlurper().parseText( http.getResponseBody() )\nresult.paths.each { String i ->\n if (i.contains(\"healthz\")) { \n def lm_wildvalue = i\n request_endpoint = \"https://${kubernetes_service_host}${lm_wildvalue}\"\n\n // Make safe endpoints with spaces\n request_endpoint = request_endpoint.replaceAll(\" \", \"%20\")\n\n http.get(request_endpoint, request_headers)\n\n if (http.statusCode == 200) { \n def health_check = http.getResponseBody().contains(\"ok\") ? 1 : 0\n println lm_wildvalue + \".health_check=\" + health_check\n }\n } \n}\n\nhttp.close()\n\nreturn 0"}, "datapoints": [{"name": "ok", "description": "General health status of various Kubernetes services.\n\nStatus codes:\n1 = OK\n0 = Not OK", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.health_check", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "!= 1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "Failed Kubernetes Health Check", "alertBody": "The health status of a Kubernetes service on ##HOST## is now ##VALUE## (1=ok), putting the host in ##LEVEL## state.\n\nThis has been ongoing since ##START##, -- or for ##DURATION##."}], "graphs": [{"name": "Health Check Status", "title": "Health Check Status", "verticalLabel": "status (1=ok)", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ok", "datapointName": "ok", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Health Check (1=ok)", "color": "silver", "datapointName": "ok", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Kubernetes Services by Health Check Status", "title": "Top 10 Kubernetes Services by Health Check Status", "verticalLabel": "status (1=ok)", "min": -1.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ok", "datapointName": "ok", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "##INSTANCE## (1=ok)", "color": "silver", "datapointName": "ok", "isVirtual": false}]}]}

×DataSource: Kubernetes_Cluster_Aggregate (1653)

{"name": "Kubernetes_Cluster_Aggregate", "description": "A DataSource for aggregating data across Kubernetes Nodes, Pods, and Containers.", "appliesTo": "hasCategory(\"KubernetesLogicalService\")", "searchKeywords": "kubernetes,cluster,container orchestration", "technicalNotes": "https://github.com/logicmonitor/k8s-argus", "displayedAs": "Aggregate Cluster Performance", "collectionInterval": "5m", "collectionMethod": "aggregate", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "container_cpu_usageCoreNanoSeconds_avg", "description": "Average of cpu_usageCoreNanoSeconds across grouped Containers.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Container\",\"dataPointName\":\"cpu_usageCoreNanoSeconds\",\"funcName\":\"mean\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "container_cpu_usageCoreNanoSeconds_max", "description": "Maximum of cpu_usageCoreNanoSeconds across grouped Containers.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Container\",\"dataPointName\":\"cpu_usageCoreNanoSeconds\",\"funcName\":\"maximum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "container_health_running_sum", "description": "Sum of health_running across grouped Containers.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Container\",\"dataPointName\":\"health_running\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "container_memory_usageBytes_avg", "description": "Average of memory_usageBytes across grouped Containers.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Container\",\"dataPointName\":\"memory_usageBytes\",\"funcName\":\"mean\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "container_memory_usageBytes_max", "description": "Maximum of memory_usageBytes across grouped Containers.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Container\",\"dataPointName\":\"memory_usageBytes\",\"funcName\":\"maximum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "container_status_restartCount_max", "description": "Maximum of status_restartCount across grouped Containers.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Container\",\"dataPointName\":\"status_restartCount\",\"funcName\":\"maximum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "container_status_restartCount_sum", "description": "Sum of status_restartCount across grouped Containers.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Container\",\"dataPointName\":\"status_restartCount\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "node_allocatable_cpu_sum", "description": "Sum of allocatable_cpu across grouped Nodes.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Node\",\"dataPointName\":\"allocatable_cpu\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "node_allocatable_memory_sum", "description": "Sum of allocatable_memory across grouped Nodes.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Node\",\"dataPointName\":\"allocatable_memory\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "node_capacity_cpu_sum", "description": "Sum of capacity_cpu across grouped Nodes.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Node\",\"dataPointName\":\"capacity_cpu\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "node_capacity_memory_sum", "description": "Sum of capacity_memory across grouped Nodes.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Node\",\"dataPointName\":\"capacity_memory\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "node_cpulimits_sum", "description": "Sum of cpulimits across grouped Nodes.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Node\",\"dataPointName\":\"cpulimits\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "node_cpurequests_sum", "description": "Sum of cpurequests across grouped Nodes.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Node\",\"dataPointName\":\"cpurequests\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "node_memorylimits_sum", "description": "Sum of memorylimits across grouped Nodes.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Node\",\"dataPointName\":\"memorylimits\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "node_memoryrequests_sum", "description": "Sum of memoryrequests across grouped Nodes.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Node\",\"dataPointName\":\"memorylimits\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "node_ready_sum", "description": "Sum of ready Nodes", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Node\",\"dataPointName\":\"ready\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pod_cpu_limits_sum", "description": "Sum of cpu_limits across Kubernetes Pods.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Pod\",\"dataPointName\":\"cpu_limits\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pod_cpu_requests_sum", "description": "Sum of cpu_requests across Kubernetes Pods.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Pod\",\"dataPointName\":\"cpu_requests\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pod_cpu_usageCoreNanoSeconds_avg", "description": "Average of usageCoreNanoSeconds across Kubernetes Pods.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Pod\",\"dataPointName\":\"cpu_usageCoreNanoSeconds\",\"funcName\":\"mean\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pod_cpu_usageCoreNanoSeconds_max", "description": "Max of usageCoreNanoSeconds across Kubernetes Pods.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Pod\",\"dataPointName\":\"cpu_usageCoreNanoSeconds\",\"funcName\":\"maximum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pod_memory_limits_sum", "description": "Sum of memory_limits across Kubernetes Pods.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Pod\",\"dataPointName\":\"memory_limits\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pod_memory_requests_sum", "description": "Sum of memory_requests across Kubernetes Pods.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Pod\",\"dataPointName\":\"memory_requests\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pod_memory_usageBytes_avg", "description": "Average memory_usageBytes across Kubernetes Pods.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Pod\",\"dataPointName\":\"memory_usageBytes\",\"funcName\":\"mean\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pod_memory_usageBytes_max", "description": "Max memory usage across Kubernetes Pods.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Pod\",\"dataPointName\":\"memory_usageBytes\",\"funcName\":\"maximum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pod_network_rxBits_max", "description": "Maximum of network_rxBits across Kubernetes Pods.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Pod\",\"dataPointName\":\"network_rxBits\",\"funcName\":\"maximum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pod_network_txBits_max", "description": "Maximum network_txBits across Kubernetes Pods.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Pod\",\"dataPointName\":\"network_txBits\",\"funcName\":\"maximum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pod_up_sum", "description": "Sum of pod_up across Kubernetes Pods.", "interpretMethod": "aggregation", "interpretExpr": "{\"version\":\"1.0\",\"expression\":{\"dataSourceName\":\"Kubernetes_Pod\",\"dataPointName\":\"pod_up\",\"funcName\":\"sum\",\"instanceFilter\":\"*\"},\"dataLack\":\"ignore\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Cluster CPU Requests and Limits", "title": "Cluster CPU Requests and Limits", "verticalLabel": "cores", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "node_capacity_cpu_sum", "datapointName": "node_capacity_cpu_sum", "consolidationFn": "average"}, {"name": "node_cpulimits_sum", "datapointName": "node_cpulimits_sum", "consolidationFn": "average"}, {"name": "node_cpurequests_sum", "datapointName": "node_cpurequests_sum", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Node CPU Capacity Sum", "color": "silver", "datapointName": "node_capacity_cpu_sum", "isVirtual": false}, {"type": "area", "legend": "Node CPU Limits Sum", "color": "olive", "datapointName": "node_cpulimits_sum", "isVirtual": false}, {"type": "area", "legend": "Node CPU Requests Sum", "color": "red", "datapointName": "node_cpurequests_sum", "isVirtual": false}]}, {"name": "Cluster Memory Requests and Limits", "title": "Cluster Memory Requests and Limits", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "node_capacity_memory_sum", "datapointName": "node_capacity_memory_sum", "consolidationFn": "average"}, {"name": "node_memorylimits_sum", "datapointName": "node_memorylimits_sum", "consolidationFn": "average"}, {"name": "node_memoryrequests_sum", "datapointName": "node_memoryrequests_sum", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Node Capacity Memory Sum", "color": "silver", "datapointName": "node_capacity_memory_sum", "isVirtual": false}, {"type": "area", "legend": "Node Memory Limits Sum", "color": "olive", "datapointName": "node_memorylimits_sum", "isVirtual": false}, {"type": "area", "legend": "Node Memory Requests Sum", "color": "red", "datapointName": "node_memoryrequests_sum", "isVirtual": false}]}, {"name": "Container CPU Time", "title": "Container CPU Time", "verticalLabel": "nanoseconds", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "container_cpu_usageCoreNanoSeconds_avg", "datapointName": "container_cpu_usageCoreNanoSeconds_avg", "consolidationFn": "average"}, {"name": "container_cpu_usageCoreNanoSeconds_max", "datapointName": "container_cpu_usageCoreNanoSeconds_max", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Average Container CPU Core Usage Time", "color": "teal", "datapointName": "container_cpu_usageCoreNanoSeconds_avg", "isVirtual": false}, {"type": "line", "legend": "Max Container CPU Core Usage Time", "color": "orange2", "datapointName": "container_cpu_usageCoreNanoSeconds_max", "isVirtual": false}]}, {"name": "Container Health", "title": "Container Health", "verticalLabel": "status", "min": 0.0, "displayPriority": 12, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "container_health_running_sum", "datapointName": "container_health_running_sum", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Sum of Container Healths", "color": "olive", "datapointName": "container_health_running_sum", "isVirtual": false}]}, {"name": "Container Memory Usage", "title": "Container Memory Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "container_memory_usageBytes_avg", "datapointName": "container_memory_usageBytes_avg", "consolidationFn": "average"}, {"name": "container_memory_usageBytes_max", "datapointName": "container_memory_usageBytes_max", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Container Average Memory Usage", "color": "navy", "datapointName": "container_memory_usageBytes_avg", "isVirtual": false}, {"type": "line", "legend": "Container Max Memory Usage", "color": "yellow", "datapointName": "container_memory_usageBytes_max", "isVirtual": false}]}, {"name": "Container Restarts", "title": "Container Restarts", "verticalLabel": "count", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "container_status_restartCount_max", "datapointName": "container_status_restartCount_max", "consolidationFn": "max"}, {"name": "container_status_restartCount_sum", "datapointName": "container_status_restartCount_sum", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Max Container Restarts", "color": "red", "datapointName": "container_status_restartCount_max", "isVirtual": false}, {"type": "line", "legend": "Total Container Restarts", "color": "orange2", "datapointName": "container_status_restartCount_sum", "isVirtual": false}]}, {"name": "Node CPU Requests and Limits", "title": "Node CPU Requests and Limits", "verticalLabel": "cores", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "node_capacity_cpu_sum", "datapointName": "node_capacity_cpu_sum", "consolidationFn": "average"}, {"name": "node_cpulimits_sum", "datapointName": "node_cpulimits_sum", "consolidationFn": "average"}, {"name": "node_cpurequests_sum", "datapointName": "node_cpurequests_sum", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Node CPU Capacity Sum", "color": "blue", "datapointName": "node_capacity_cpu_sum", "isVirtual": false}, {"type": "line", "legend": "Node CPU Limits Sum", "color": "green", "datapointName": "node_cpulimits_sum", "isVirtual": false}, {"type": "line", "legend": "Node CPU Requests Sum", "color": "red2", "datapointName": "node_cpurequests_sum", "isVirtual": false}]}, {"name": "Node Memory Requests and Limits", "title": "Node Memory Requests and Limits", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "node_capacity_memory_sum", "datapointName": "node_capacity_memory_sum", "consolidationFn": "average"}, {"name": "node_memorylimits_sum", "datapointName": "node_memorylimits_sum", "consolidationFn": "average"}, {"name": "node_memoryrequests_sum", "datapointName": "node_memoryrequests_sum", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Node Capacity Memory Sum", "color": "silver", "datapointName": "node_capacity_memory_sum", "isVirtual": false}, {"type": "line", "legend": "Node Memory Limits Sum", "color": "olive", "datapointName": "node_memorylimits_sum", "isVirtual": false}, {"type": "line", "legend": "Node Memory Requests Sum", "color": "red", "datapointName": "node_memoryrequests_sum", "isVirtual": false}]}, {"name": "Pod CPU Requests and Limits", "title": "Pod CPU Requests and Limits", "verticalLabel": "cores", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "pod_cpu_limits_sum", "datapointName": "pod_cpu_limits_sum", "consolidationFn": "average"}, {"name": "pod_cpu_requests_sum", "datapointName": "pod_cpu_requests_sum", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Pod CPU Limits Sum", "color": "yellow", "datapointName": "pod_cpu_limits_sum", "isVirtual": false}, {"type": "line", "legend": "Pod CPU Requests Sum", "color": "green", "datapointName": "pod_cpu_requests_sum", "isVirtual": false}]}, {"name": "Pod CPU Time", "title": "Pod CPU Time", "verticalLabel": "nanoseconds", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "pod_cpu_usageCoreNanoSeconds_avg", "datapointName": "pod_cpu_usageCoreNanoSeconds_avg", "consolidationFn": "average"}, {"name": "pod_cpu_usageCoreNanoSeconds_max", "datapointName": "pod_cpu_usageCoreNanoSeconds_max", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Average Pod CPU Core Usage Time", "color": "blue", "datapointName": "pod_cpu_usageCoreNanoSeconds_avg", "isVirtual": false}, {"type": "line", "legend": "Max Pod CPU Core Usage Time", "color": "orange", "datapointName": "pod_cpu_usageCoreNanoSeconds_max", "isVirtual": false}]}, {"name": "Pod Memory Requests and Limits", "title": "Pod Memory Requests and Limits", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "pod_memory_limits_sum", "datapointName": "pod_memory_limits_sum", "consolidationFn": "average"}, {"name": "pod_memory_requests_sum", "datapointName": "pod_memory_requests_sum", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Pod Memory Limits Sum", "color": "yellow", "datapointName": "pod_memory_limits_sum", "isVirtual": false}, {"type": "line", "legend": "Pod Memory Requests Sum", "color": "olive", "datapointName": "pod_memory_requests_sum", "isVirtual": false}]}, {"name": "Pod Memory Usage", "title": "Pod Memory Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "pod_memory_usageBytes_avg", "datapointName": "pod_memory_usageBytes_avg", "consolidationFn": "average"}, {"name": "pod_memory_usageBytes_max", "datapointName": "pod_memory_usageBytes_max", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Pod Average Memory Usage", "color": "blue", "datapointName": "pod_memory_usageBytes_avg", "isVirtual": false}, {"type": "line", "legend": "Pod Max Memory Usage", "color": "orange2", "datapointName": "pod_memory_usageBytes_max", "isVirtual": false}]}, {"name": "Pod Network Traffic Overview", "title": "Pod Network Traffic Overview", "verticalLabel": "bps", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "pod_network_rxBits_max", "datapointName": "pod_network_rxBits_max", "consolidationFn": "average"}, {"name": "pod_network_txBits_max", "datapointName": "pod_network_txBits_max", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Pod Network Rx Bits Max", "color": "blue", "datapointName": "pod_network_rxBits_max", "isVirtual": false}, {"type": "line", "legend": "Pod Network Tx Bits Max", "color": "green", "datapointName": "pod_network_txBits_max", "isVirtual": false}]}, {"name": "Running Pods", "title": "Running Pods", "verticalLabel": "pods", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "pod_up_sum", "datapointName": "pod_up_sum", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "Pods Up Sum", "color": "navy", "datapointName": "pod_up_sum", "isVirtual": false}]}]}

×DataSource: VMware_vCenter_HostInterfaces (762)

{"name": "VMware_vCenter_HostInterfaces", "description": "Monitors various performance and health metrics of the ESXi host interfaces", "appliesTo": "system.virtualization =~ \"VMware ESX vcenter\"", "searchKeywords": "application,virtualization,vm,vmware,vcenter", "displayedAs": "VMware Host Interfaces", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.esx.ESX;\nimport com.vmware.vim25.mo.*;\n\ndef host = hostProps.get(\"system.hostname\");\ndef user = hostProps.get(\"esx.user\");\ndef pass = hostProps.get(\"esx.pass\");\ndef addr = hostProps.get(\"esx.url\") ?: \"https://${host}/sdk\";\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\nreservedAddresses = [\"00:00:00\", \"00:00:5e\", \"01:00:5e\", \"33:33\"]\n\ndef svc = new ESX();\nsvc.open(addr, user, pass, 10 * 1000); // timeout in 10 seconds\n\ndef si = svc.getServiceInstance();\ndef rootFolder = si.getRootFolder();\n\n// Get resource clusters\nHostSystem[] esxHosts = new InventoryNavigator(rootFolder).searchManagedEntities(\"HostSystem\")\n\n// Iterate over each physical NIC\nesxHosts.each { esx ->\n esx?.hostNetworkSystem?.networkInfo?.pnic?.each() { nic ->\n // Is the nic active?\n if (nic.linkSpeed)\n {\n // Yes, collect instance information.\n def wildvalue = \"${esx.MOR.val}/${nic.device}\"\n def wildalias = \"${nic.device} / ${nic.mac}\"\n def description = \"${nic.linkSpeed.speedMb} Mbps ${nic.linkSpeed.duplex ? 'full-duplex' : ''}\"\n\n if(isMac(nic?.mac)) {\n ExternalResourceIDs = [\"${host}--pNic-${nic.mac}\", \"if:${nic.mac}\"]\n }\n\n // Collect properties\n instance_props = ['auto.mac_address' : nic.mac,\n 'auto.ifSpeedMb' : nic.linkSpeed.speedMb,\n 'predef.externalResourceID' : eriPreProcessor(ExternalResourceIDs, keyNamespace, keyBlacklist),\n 'predef.externalResourceType': \"PhysicalNIC\",\n 'auto.host' : esx.name,\n ]\n\n // Encode our properties\n encoded_instance_props_array = instance_props.collect()\n { property, value ->\n URLEncoder.encode(property.toString()) + \"=\" + URLEncoder.encode(value.toString())\n }\n //def properties = \"auto.mac_address=${nic.mac}&auto.ifSpeedMb=${nic.linkSpeed.speedMb}\";\n println \"${wildvalue}##${wildalias}##${description}####${encoded_instance_props_array.join(\"&\")}\"\n }\n }\n}\n\nreturn 0;\n\ndef isMac(address) {\n if(address == null) return false\n\n if (address.matches(\"[0-9a-f]{2}([-:]?)[0-9a-f]{2}(\\\\1[0-9a-f]{2}){4}\\$\")) {\n if(!reservedAddresses.find { address.startsWith(it)}) return true\n }\n return false\n}\n\ndef eriPreProcessor(List eriList, String namespace, List blacklist) {\n def output = []\n eriList.each { eri ->\n eri = eri.toLowerCase()\n eri = eri.replace(\",\", \"_\")\n if (!blacklist.contains(eri)) {\n if (namespace) {\n namespace = namespace.replace(\",\", \"_\").replace(\"&\", \"and\")\n eri = \"${namespace}::${eri}\"\n }\n output << eri\n }\n }\n return output.join(\",\")\n}"}, "groupMethod": "ilp", "groupExpr": "auto.host"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.esx.ESX;\nimport com.vmware.vim25.*;\nimport com.vmware.vim25.mo.*;\n\ndef host = hostProps.get(\"system.hostname\");\ndef user = hostProps.get(\"esx.user\");\ndef pass = hostProps.get(\"esx.pass\");\ndef addr = hostProps.get(\"esx.url\") ?: \"https://${host}/sdk\";\n\ndef pollInterval = (taskProps.get('pollinterval') ?: \"300\").toInteger();\n\ndef ag = [\"NOP\" : 1, // Use value of rollup instance.\n \"SUM\" : 2, // Sum all instances.\n \"AVG\" : 3] // Average all instances.\n\ndef perfCounters = [\"net.droppedRx.summation\" \t\t: [ag.NOP],\n \"net.droppedTx.summation\" \t\t: [ag.NOP],\n \"net.packetsRx.summation\" \t\t: [ag.NOP],\n \"net.packetsTx.summation\" \t\t: [ag.NOP],\n \"net.received.average\"\t\t\t: [ag.NOP],\n \"net.transmitted.average\"\t\t: [ag.NOP]];\n\n// Connect up to the esx service\ndef svc = new ESX();\nsvc.open(addr, user, pass, 10 * 1000); // timeout in 10 seconds\n\ndef counterIds = svc.getCounterToIdMap();\ndef counterMap = perfCounters.collectEntries { [(counterIds[it.key]): it] };\n\ndef si = svc.getServiceInstance();\ndef rootFolder = si.getRootFolder();\ndef performanceManager = si.getPerformanceManager();\n\ndef end = si.currentTime(); // Timestamp we are collecting for\ndef start = end.clone();\nstart.add(Calendar.SECOND, -pollInterval);\n\n// Collect all of the subscribed counters on all of the instances\ndef metrics = [];\n\ncounterMap.each\n{\n k, v->\n\n def id = new PerfMetricId();\n id.setCounterId(k);\n id.setInstance(\"*\");\n metrics.add(id);\n}\n\n// Get all of the host systems (it's going to be 1 on ESX hosts)\ndef hosts = new InventoryNavigator(rootFolder).searchManagedEntities(\"HostSystem\");\n\nhosts.each\n{\n esx ->\n\n def spec = new PerfQuerySpec();\n spec.setStartTime(start);\n spec.setEndTime(end);\n spec.setMaxSample(1);\n spec.setMetricId(metrics as PerfMetricId[]);\n spec.setEntity(esx.getMOR());\n\n def scalingFactor = pollInterval / 20; // Divide our poll interval by the underlying sample interval used for aggregations.\n\n try{\n def res = performanceManager.queryPerf([spec] as PerfQuerySpec[]); // Get the data\n\n // Go through every result in the response.\n for(result in res)\n {\n def instanceGroupedResutls = result.value.groupBy{it.id.counterId};\n\n instanceGroupedResutls.each\n {\n id, values->\n def counterInfo = counterMap[id];\n def fieldName = counterInfo.key.replace(\".\", \"_\");\n\n values.findAll{it.id.instance}.each {\n wildvalue = \"${esx.MOR.val}/${it.id.instance}\"\n println \"${wildvalue}.${fieldName}=${it?.value[0]}\"\n }\n }\n }\n }catch(javax.xml.ws.WebServiceException e){\n println \"Failed on ${esx.name} [Status: ${esx.overallStatus}]\"\n }\n}\n\nreturn 0;"}, "datapoints": [{"name": "DataRateRx", "description": "The rate at which data is received across each physical NIC instance on the host (KBytes per second).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.net_received_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataRateTx", "description": "The rate at which data is transmitted across each physical NIC instance on the host (KBytes per second).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.net_transmitted_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsDroppedRx", "description": "Number of receive packets dropped during the collection interval.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.net_droppedRx_summation", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": ">= 1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "vSphere/ESX host ##INSTANCE## managed by ##HOST## is now dropping ##VALUE## inbound packets per second, placing it into ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "PacketsDroppedTx", "description": "Number of transmit packets dropped during the collection interval.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.net_droppedTx_summation", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": ">= 1", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "vSphere/ESX host ##INSTANCE## managed by ##HOST## is now dropping ##VALUE## outbound packets per second, placing it into ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "PacketsRx", "description": "Total number of packets received on all virtual machines running on the host.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.net_packetsRx_summation", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsTx", "description": "Number of packets transmitted across each physical NIC instance on the host.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.net_packetsTx_summation", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}]}

×DataSource: Cisco_Transceiver_Sensors (363)

{"name": "Cisco_Transceiver_Sensors", "description": "Monitors various Cisco transceiver sensors such as temperature (C), power levels (dBm) and amperage.", "appliesTo": "isCisco() && !hasCategory(\"CiscoTransceiverCLI\")", "searchKeywords": "transceiver,sensor,networking,cisco,hardware", "technicalNotes": "Supports the following host properties:\n\n\u2022 sensor.use_alert_order\n - auto (default)\t: Use cisco provided threshold order if they are sensible\n - on\t\t\t\t: Use cisco's provided threshold spec\n - off\t\t\t: Attempt to estimate which thresholds are correct\n\nUses the ENTITY-MIB (CISCO) and ENTITY-SENSOR-MIB.", "displayedAs": "Cisco Transceiver Sensors", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get(\"system.hostname\")\n\n// SNMP Timeout (Including Retry)\ndef timeout = 60000\n\n// auto, on, off\ndef alrtOrder = (hostProps.get(\"sensor.use_alert_order\") ?: \"auto\").toLowerCase()\n\ndef scaleArray = []\nscaleArray[1] = [\"yocto\", 0.000000000000000000000001G]\nscaleArray[2] = [\"zepto\", 0.000000000000000000001G]\nscaleArray[3] = [\"atto\", 0.000000000000000001G]\nscaleArray[4] = [\"femto\", 0.000000000000001G]\nscaleArray[5] = [\"pico\", 0.000000000001G]\nscaleArray[6] = [\"nano\", 0.000000001G]\nscaleArray[7] = [\"micro\", 0.000001G]\nscaleArray[8] = [\"milli\", 0.001G]\nscaleArray[9] = [\"\", 1.0G]\nscaleArray[10] = [\"kilo\", 1000.0G]\nscaleArray[11] = [\"mega\", 1000000.0G]\nscaleArray[12] = [\"giga\", 1000000000.0G]\nscaleArray[13] = [\"tera\", 1000000000000.0G]\nscaleArray[15] = [\"peta\", 1000000000000000.0G] // - 15 bad cisco order\nscaleArray[14] = [\"exa\", 1000000000000000000.0G] // - 14 bad cisco order\nscaleArray[16] = [\"zetta\", 1000000000000000000000.0G]\nscaleArray[17] = [\"yotta\", 1000000000000000000000000.0G]\n\ndef typeArray = new String[16]\ntypeArray[1] = \"other\"\ntypeArray[2] = \"unknown\"\ntypeArray[3] = \"volts AC\"\ntypeArray[4] = \"volts DC\"\ntypeArray[5] = \"amperes\"\ntypeArray[6] = \"watts\"\ntypeArray[7] = \"hertz\"\ntypeArray[8] = \"celsius\"\ntypeArray[9] = \"% RH\"\ntypeArray[10] = \"rpm\"\ntypeArray[11] = \"cmm\"\ntypeArray[12] = \"truth value\"\ntypeArray[13] = \"special Enum\"\ntypeArray[14] = \"dBm\"\ntypeArray[15] = \"dB\"\n\ndef metricFilter = [ // Scale,Type, Min, Max \t// 0 is a wildcard\n\t\t\t\t\t [9, 8, -35, 100], // Celcius, normal scale.\n\t\t\t\t\t [8, 8, 0, 0], // Millicelcius. Set min and max to filter it.\n\t\t\t\t\t [9, 14, -25, 25], // A dbm value below -25 is usually a noise floor.\n\t\t\t\t\t [0, 1, 0, 0] // Any Other. Set min and max to filter it.\n]\n\n// We use custom retry logic for our walks as these devices sometimes report a timeout long before the number of seconds is up.\ndef types = getSnmpWalkWithRetry(host, \"1.3.6.1.4.1.9.9.91.1.1.1.1.1\", timeout)\ndef scale = getSnmpWalkWithRetry(host, \"1.3.6.1.4.1.9.9.91.1.1.1.1.2\", timeout)\ndef pcisn = getSnmpWalkWithRetry(host, \"1.3.6.1.4.1.9.9.91.1.1.1.1.3\", timeout)\ndef value = getSnmpWalkWithRetry(host, \"1.3.6.1.4.1.9.9.91.1.1.1.1.4\", timeout)\n\ndef alert = getSnmpWalkWithRetry(host, \"1.3.6.1.4.1.9.9.91.1.2.1.1.4\", timeout)\ndef alTyp = getSnmpWalkWithRetry(host, \"1.3.6.1.4.1.9.9.91.1.2.1.1.3\", timeout)\n\ndef names = getSnmpWalkWithRetry(host, \"1.3.6.1.2.1.47.1.1.1.1.7\", timeout)\n\ndef ifDsc = getSnmpWalkWithRetry(host, \"1.3.6.1.2.1.2.2.1.2\", timeout)\n\n// Make a list of possible interfaces that could match a sensor\ndef ifDscMerge = [:]\n\nifDsc.each { k, v->\n\tdef ifName = (v =~ /.*?([\\d\\/]+)/)\n\n\tif(ifName.getCount()) {\n\t\tdef ifLocation = ifName[0][1]\n\n\t\tif(!ifDscMerge[ifLocation]) {\n\t\t\tifDscMerge[ifLocation] = []\n\t\t}\n\n\t\tifDscMerge[ifLocation].push(k)\n\t}\n}\n\n// If we have instances with multiple names, typically the smallest is correct.\n// Example:\tTenGigabitEthernet1/1--Uncontrolled\n//\t\t\tTenGigabitEthernet1/1--Controlled\n//\t\t\tTenGigabitEthernet1/1\n\nifDscMerge.each {\n\tif(it.value.size() > 1) {\n\t\tit.value = [it.value.sort { ifDsc[it].length() }.first()]\n\t}\n}\n\n// We do an early test loop to validate which approach to alerting is most sensible.\ntypes.each { wildvalue, metricType ->\n\t// Thereshold checking\n\tif (alrtOrder == \"auto\") {\n\t\tdef lt = []\n\t\tdef gt = []\n\n\t\talert.findAll { it.key.startsWith(\"${wildvalue}.\") }.each {\n\t\t\tdef thresholdType = alTyp[it.key]\n\n\t\t\tif (thresholdType == \"1\" || thresholdType == \"2\") {\n\t\t\t\tlt.push(it.value.toInteger())\n\t\t\t}\n\n\t\t\tif (thresholdType == \"3\" || thresholdType == \"4\") {\n\t\t\t\tgt.push(it.value.toInteger())\n\t\t\t}\n\t\t}\n\n\t\tif (gt.min() != null && lt.max() != null && gt.min() <= lt.max()) {\n\t\t\t// Using the cisco provided threshold order creates a perminant alert. Assuming untrustworthy alert order.\n\t\t\talrtOrder = \"off\"\n\t\t}\n\t}\n}\n\ndef useAlrtOrder = (alrtOrder != \"off\")\n\ntypes.each { wildvalue, typeId ->\n\tdef name = names[wildvalue] ?: \"Unnamed Sensor [ID ${wildvalue}]\"\n\n\t// This is the scaling calculation Cico provides in the MIB's description\n\tdef scaleId = (scale[wildvalue] ?: 9).toInteger()\n\tdef (scaleName, scaleValue) = scaleArray[scaleId]\n\tdef pcisnValue = (pcisn[wildvalue] ?: 0).toInteger()\n\n\tdef modifier = scaleValue.movePointLeft(pcisnValue)\n\tdef modifiedValue = value[wildvalue].toBigDecimal() * modifier\n\n\tdef valid = true\n\n\tmetricFilter.each { filter ->\n\t\tdef (filterScaleId, filterTypeId, filterMin, filterMax) = filter\n\n\t\tif ((filterScaleId == 0 || filterScaleId == scaleId) && (filterTypeId == 0 || filterTypeId == typeId.toInteger())) {\n\t\t\tif (modifiedValue <= filterMin || modifiedValue >= filterMax) {\n\t\t\t\t// The value falls outside of acceptable limits and is invalid.\n\t\t\t\tvalid = false\n\t\t\t}\n\t\t}\n\t}\n\n\tif (valid) {\n\t\tdef unitDisplay = \"${scaleName}${typeArray[typeId.toInteger()]}\"\n\n\t\tprint \"${wildvalue}##${name}##${unitDisplay}####\"\n\t\tprint \"auto.sensor.unit=${unitDisplay}\"\n\n\t\tdef lt = []\n\t\tdef gt = []\n\n\t\talert.findAll { it.key.startsWith(\"${wildvalue}.\") }.each {\n\t\t\tdef thresholdType = alTyp[it.key]\n\n\t\t\tif (thresholdType == \"1\" || thresholdType == \"2\") {\n\t\t\t\tlt.push(it.value.toInteger())\n\t\t\t}\n\n\t\t\tif (thresholdType == \"3\" || thresholdType == \"4\") {\n\t\t\t\tgt.push(it.value.toInteger())\n\t\t\t}\n\t\t}\n\n\t\tif (!useAlrtOrder) {\n\t\t\tdef combined = (lt + gt).sort()\n\n\t\t\tlt = combined.take(lt.size())\n\t\t\tgt = combined.takeRight(gt.size())\n\n\t\t\twhile (gt.min() != null && lt.max() != null && gt.min() <= lt.max()) {\n\t\t\t\t// There is still no situation in which these won't alert.\n\t\t\t\t// Assume that the set with the biggest delta has a bad value, and remove the closest to the other set.\n\t\t\t\tif (Math.abs(lt.first() - lt.last()) < Math.abs(gt.first() - gt.last())) {\n\t\t\t\t\tgt.remove(0)\n\t\t\t\t} else {\n\t\t\t\t\tlt.pop()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlt = lt.sort()\n\t\tprint \"&auto.sensor.low_alarm=${lt[0] != null ? '0' + lt[0] * modifier : ''}\"\n\t\tprint \"&auto.sensor.low_warning=${lt[1] != null ? '0' + lt[1] * modifier : ''}\"\n\n\t\tgt = gt.sort().reverse()\n\t\tprint \"&auto.sensor.high_alarm=${gt[0] != null ? '0' + gt[0] * modifier : ''}\"\n\t\tprint \"&auto.sensor.high_warning=${gt[1] != null ? '0' + gt[1] * modifier : ''}\"\n\n\t\tdef ifMatcher = name =~ /.*?([\\d\\/]+)/\n\n\t\tif(ifMatcher.getCount()) {\n\t\t\tprint \"&auto.sensor.parent_interface=${ifDscMerge[ifMatcher[0][1]]?.first()}\"\n\t\t}\n\t\t\n\t\tprint \"&auto.debug.fixed_thresholds=${!useAlrtOrder}\"\n\t\tprintln \"&auto.sensor.scale=${modifier}\"\n\t}\n}\n\ndef getSnmpWalkWithRetry(host, oid, timeout) {\n\tdef start = System.currentTimeMillis()\n\n\twhile ((System.currentTimeMillis() - start) < timeout) {\n\t\ttry {\n\t\t\treturn Snmp.walkAsMap(host, oid, null, timeout)\n\t\t}\n\t\tcatch (ex) {\n\t\t\tif (!ex.message.contains(\"errorMsg=Request timed out\")) {\n\t\t\t\tthrow ex\n\t\t\t}\n\t\t\tsleep(500)\n\t\t}\n\t}\n\n\tthrow new Exception(\"Failed to snmp walk for ${timeout} seconds\")\n}\n\nreturn 0"}, "filters": [{"attr": "##WILDALIAS##", "op": "RegexMatch", "value": "(Gi|Te|Transceiver|Ethernet)\\s*([\\d\\/]+)"}], "groupMethod": "ilp", "groupExpr": "auto.sensor.unit"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get(\"system.hostname\")\n\ndef timeout = 60000\n\ndef valueMap = getSnmpWalkWithRetry(host, \"1.3.6.1.4.1.9.9.91.1.1.1.1.4\", timeout)\ndef stateMap = getSnmpWalkWithRetry(host, \"1.3.6.1.4.1.9.9.91.1.1.1.1.5\", timeout)\ndef alertMap = getSnmpWalkWithRetry(host, \"1.3.6.1.4.1.9.9.91.1.2.1.1.5\", timeout)\ndef ifStsMap = getSnmpWalkWithRetry(host, \"1.3.6.1.2.1.2.2.1.8\", timeout)\n\n// Combine alerts if multiple thresholds exist\ndef alertCombinedMap = [:]\n \nalertMap.each { it, val ->\n\tdef tokens = it.tokenize('.')\n \n\tif(!alertCombinedMap.containsKey(tokens.first())) {\n\t\talertCombinedMap[tokens.first()] = []\n\t}\n \n\talertCombinedMap[tokens.first()].push(val.toInteger())\n}\n\nvalueMap.each { wild, val ->\n\tprintln \"${wild}.raw_sensor_value=${val}\"\n\tprintln \"${wild}.sensor_status=${stateMap[wild]}\"\n\tprintln \"${wild}.threshold_evaluation=${alertCombinedMap[wild]?.min() == 1 ? 1 : 0}\"\n\n\tifStsMap.each { oid, state ->\n\t\tprintln \"${wild}.${oid}-ifstate=${state}\"\n\t}\n}\n\nreturn 0\n\ndef getSnmpWalkWithRetry(host, oid, timeout) {\n\tdef start = System.currentTimeMillis()\n\n\twhile ((System.currentTimeMillis() - start) < timeout) {\n\t\ttry {\n\t\t\treturn Snmp.walkAsMap(host, oid, null, timeout)\n\t\t}\n\t\tcatch (ex) {\n\t\t\tif (!ex.message.contains(\"errorMsg=Request timed out\")) {\n\t\t\t\t// The error wasn't a timeout. Don't retry.\n\t\t\t\tthrow ex\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow new Exception(\"Failed to snmp walk for ${timeout} seconds\")\n}"}, "datapoints": [{"name": "high_alarm", "description": "Configured high alarm threshold for the specified sensor.", "interpretMethod": "expression", "interpretExpr": "if(un(raw_sensor_value),unkn(),##auto.sensor.high_alarm##)", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "high_alert", "description": "Alerts if the sensor value surpassed the high warning and alarm threshold.\n\nStatus codes:\n0=Ok,\n1=Above high warning threshold,\n2=Above high alarm/error threshold", "interpretMethod": "expression", "interpretExpr": "if(un(sensor_parent_interface_status),0-1,if(eq(threshold_evaluation,0),0,if(gt(sensor_parent_interface_status,1),(0-1),if(gt(sensor_value, high_warning),(if(gt(sensor_value, high_alarm),2,1)),0))))", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "threshold": "= 1 2", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "Cisco sensor ##INSTANCE## on ##HOST## is returning an alert threshold status code of ##VALUE## ##auto.sensor.unit## meaning it has gone above a configured threshold, placing the sensor into ##LEVEL## state.\n\nStatus codes:\n0=Ok,\n1=Above high warning threshold,\n2=Above high alarm/error threshold\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "high_warning", "description": "Configured high warning threshold for the specified sensor.", "interpretMethod": "expression", "interpretExpr": "if(un(raw_sensor_value),unkn(),##auto.sensor.high_warning##)", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "low_alarm", "description": "Configured low alarm threshold for the specified sensor.", "interpretMethod": "expression", "interpretExpr": "if(un(raw_sensor_value),unkn(),##auto.sensor.low_alarm##)", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "low_alert", "description": "Alerts if the sensor value surpassed the low warning and alarm threshold.\n\nStatus codes:\n0=Ok,\n1=Below low warning threshold,\n2=Below low alarm/error threshold", "interpretMethod": "expression", "interpretExpr": "if(un(sensor_parent_interface_status),0-1,if(eq(threshold_evaluation,0),0,if(gt(sensor_parent_interface_status,1),(0-1),if(lt(sensor_value,0-30),(0-1),if(lt(sensor_value,low_warning),(if(lt(sensor_value,low_alarm),2,1)),0)))))", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "threshold": "= 1 2", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "Cisco sensor ##INSTANCE## on ##HOST## is returning an alert threshold status code of ##VALUE## ##auto.sensor.unit## meaning it has gone below a configured threshold, placing the sensor into ##LEVEL## state.\n\nStatus codes:\n0=Ok,\n1=Below low warning threshold,\n2=Below low alarm/error threshold\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "low_warning", "description": "Configured low warning threshold for the specified sensor.", "interpretMethod": "expression", "interpretExpr": "if(un(raw_sensor_value),unkn(),##auto.sensor.low_warning##)", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "raw_sensor_value", "description": "The sensor value without scale or precision involved.\n\nSee graph label for units.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.raw_sensor_value", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sensor_parent_interface_status", "description": "Operational status of the interface.\n\nStatus codes:\n1=Up - Ready to pass packets,\n2=Down,\n3=Testing - in a test mode,\n4=Unknown - status cannot be determined,\n5=Dormant - interface is not actually in a condition to pass packets (i.e., it is not 'up') but is in a \"pending\" state, waiting for some external event.,\n6=Not Present - some component is missing,\n7=Lower Layer Down - down due to state of a lower-layer interface(s).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.##auto.sensor.parent_interface##-ifstate", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sensor_status", "description": "Sensor operating status.\n\nStatus codes:\n1=Ok,\n2=Unavailable,\n3=Non-Operational", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sensor_status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "1", "max": "3", "threshold": "= 3", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 2, "alertBody": "Cisco sensor ##INSTANCE## (##auto.unit##) on ##HOST## is no longer in an optimal operating state and is non-operational, placing the sensor into ##LEVEL## state. The device is reporting a status code of ##VALUE##.\n\nStatus codes:\n1=Ok,\n2=Unavailable,\n3=Non-Operational\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "sensor_value", "description": "The sensor's real value.", "interpretMethod": "expression", "interpretExpr": "if(un(raw_sensor_value),unkn(),raw_sensor_value * ##auto.sensor.scale##)", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "threshold_evaluation", "description": "Returns 1 if cisco reports a threshold is broken in a way that should result in an alert state (otherwise returns 0).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.threshold_evaluation", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Cisco Threshold Evaluation", "title": "Cisco Threshold Evaluation", "verticalLabel": "0 = ok, 1 = alert", "min": 0.0, "max": 1.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "threshold_evaluation", "datapointName": "threshold_evaluation", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Cisco Threshold Evaluation", "color": "red", "datapointName": "threshold_evaluation", "isVirtual": false}]}, {"name": "Sensor Reading", "title": "Sensor Reading", "verticalLabel": "##DSIDESCRIPTION##", "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "high_alarm", "datapointName": "high_alarm", "consolidationFn": "average"}, {"name": "high_warning", "datapointName": "high_warning", "consolidationFn": "average"}, {"name": "low_alarm", "datapointName": "low_alarm", "consolidationFn": "average"}, {"name": "low_warning", "datapointName": "low_warning", "consolidationFn": "average"}, {"name": "scaled_sensor_value", "datapointName": "sensor_value", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "High Alarm", "color": "red", "datapointName": "high_alarm", "isVirtual": false}, {"type": "line", "legend": "High Warning", "color": "orange2", "datapointName": "high_warning", "isVirtual": false}, {"type": "line", "legend": "Low Alarm", "color": "navy", "datapointName": "low_alarm", "isVirtual": false}, {"type": "line", "legend": "Low Warning", "color": "aqua", "datapointName": "low_warning", "isVirtual": false}, {"type": "line", "legend": "Value", "color": "gray", "datapointName": "scaled_sensor_value", "isVirtual": false}]}, {"name": "Sensor Status", "title": "Sensor Status", "verticalLabel": "1 = ok, 2 = unavailable, 3 = non-operational", "min": 0.0, "max": 4.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "sensor_status", "datapointName": "sensor_status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "gray", "datapointName": "sensor_status", "isVirtual": false}]}, {"name": "Threshold Alert Level", "title": "Threshold Alert Level", "verticalLabel": "0 = ok, 1 = warning, 2 = error", "min": -1.0, "max": 3.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "high_alert", "datapointName": "high_alert", "consolidationFn": "average"}, {"name": "low_alert", "datapointName": "low_alert", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "High Alert", "color": "red2", "datapointName": "high_alert", "isVirtual": false}, {"type": "line", "legend": "Low Alert", "color": "purple", "datapointName": "low_alert", "isVirtual": false}]}], "overviewGraphs": [{"name": "Sensor Reading Overview", "title": "Sensor Reading Overview", "verticalLabel": "value", "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "scaled_sensor_value", "datapointName": "sensor_value", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "scaled_sensor_value", "isVirtual": false}]}, {"name": "Sensor Status Overview", "title": "Sensor Status Overview", "verticalLabel": "1 = ok, 2 = unavailable, 3 = non-operational", "min": 0.0, "max": 4.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "sensor_status", "datapointName": "sensor_status", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "sensor_status", "isVirtual": false}]}]}

×DataSource: Cisco_APIC_Interfaces (213)

{"name": "Cisco_APIC_Interfaces", "description": "Obtains information about interface performance via the APIC API", "appliesTo": "hasCategory(\"CiscoAPIC\")", "searchKeywords": "interfaces,apic,aci,cisco", "technicalNotes": "Please apply the following device properties:\napic.api.user\napic.api.pass\n\napic.api.port (optional)\napic.api.threads (optional)\n\n\nAPI REFERENCE\nhttps://developer.cisco.com/site/apic-mim-ref-api/?version=3.2(1)", "displayedAs": "Cisco APIC Interfaces", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.util.Settings\nimport groovy.json.JsonSlurper\nimport groovy.json.JsonOutput\n\nimport java.util.concurrent.Callable\nimport java.util.concurrent.Executors\nimport java.util.concurrent.TimeUnit\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"apic.api.user\")\ndef pass = hostProps.get(\"apic.api.pass\")\ndef port = hostProps.get(\"apic.api.port\", \"443\").toInteger()\ndef threads = hostProps.get(\"apic.api.threads\", \"4\").toInteger()\n\n// To run in debug mode, set to true\ndef debug = false\n\n// Get start time for script for threadpool cleanup\nlong startTime = System.currentTimeMillis()\n\ndef modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\ndef lmDebug = modLoader.load(\"lm.debug\", \"0\") // Load LM debug module\ndef lmAPIC = modLoader.load(\"cisco.apic\", \"0\") // Load Cisco APIC module\n\ndef authData =\n[\"aaaUser\":[\"attributes\":[\"name\":\"${user}\",\"pwd\":\"${pass}\"]]]\n\ndef jsonAuth = JsonOutput.toJson(authData)\n\ndef cookie = lmAPIC.getCookie(\"https://${host}:${port}/api/aaaLogin.json\", jsonAuth)\n\n// Get the script timeout and convert to ms\nInteger timeout = Settings.getSetting(\"collector.script.timeout\").toInteger() * 1000\nlmDebug.LMDebugPrint(\"Script timeout set to ${timeout / 1000} seconds\\n\", debug)\n\ndef macs = lmAPIC.getMACAddresses(host, port)\ndef interfaces = lmAPIC.getData(\"https://${host}:${port}/api/node/class/l1PhysIf.json\", cookie)\ndef threadPool = Executors.newFixedThreadPool(threads)\n\nlmDebug.LMDebugPrint(\"\\nCreating threadpool with ${threads} threads for collecting interface data.\", debug)\n\ntry{\n\tinterfaces['imdata'].each { iface ->\n\t\tthreadPool.submit {\n\t\t\tdef attr = iface.values().first()['attributes']\n\t\t\tdef dn = attr['dn']\n\n\t\t\tdef interfaceStats = lmAPIC.getData(\"https://${host}:${port}/api/node/mo/${dn}/dbgEtherStats.json\", cookie)\n\t\t\tdef interfaceOctets = interfaceStats.imdata[0]?.rmonEtherStats?.attributes?.octets\n\t\t\tdef hasTraffic = ![null, \"0\"].contains(interfaceOctets)\n\t\t\tdef tokens = dn.split('/')\n\t\t\tdef pod = tokens[1]\n\t\t\tdef node = tokens[2]\n\t\t\tdef mac = macs[dn]\n\n\t\t\tdef ilp =\n\t\t\t[\"auto.apic.grouping\" : \"${pod} - ${node}\",\n\t\t\t \"auto.apic.mac\" : mac,\n\t\t\t \"auto.apic.hastraffic\": hasTraffic]\n\n\t\t\tlmEmit.instance(dn, \"${pod} - ${node} - ${attr['id']}\", ilp)\n\t\t} as Callable\n\t}\n}\nfinally\n{\n\t// Initiate an orderly shutdown of the threadpool\n\tthreadPool.shutdown()\n\n\tlong now = System.currentTimeMillis()\n\tlmDebug.LMDebugPrint(\"Current time: ${now}\\t(${now - startTime} ms elapsed)\", debug)\n\n\t// Calculate the remaining execution time\n\tdef remaining = ((timeout - now + startTime) - 5000)\n\tlmDebug.LMDebugPrint(\"Calculated remaining script time as ${remaining / 1000} seconds\", debug)\n\n\t// Block until the script times out or all tasks have finished executing\n\ttry {\n\t\tif (!threadPool.awaitTermination(remaining, TimeUnit.MILLISECONDS)) {\n\t\t\tlmDebug.LMDebugPrint(\"Ran out of time to finish execution, shutting down the rest of the threads\", debug)\n\t\t\t// Force all remaining tasks in the pool to abort\n\t\t\tthreadPool.shutdownNow()\n\t\t}\n\t}\n\tcatch (e) {\n\t\tthreadPool.shutdownNow()\n\t}\n\tlong newNow = System.currentTimeMillis()\n\tlmDebug.LMDebugPrint(\"Shutdown time: ${newNow}\\t(${newNow - startTime} ms elapsed)\", debug)\n}\n\nreturn 0"}, "filters": [{"attr": "auto.apic.hastraffic", "op": "Equal", "value": "true", "comment": "Only monitor interfaces with traffic."}], "groupMethod": "ilp", "groupExpr": "auto.apic.grouping"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.util.Settings\n\nimport java.util.concurrent.*\nimport groovy.json.JsonSlurper\nimport groovy.json.JsonOutput\n \ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"apic.api.user\")\ndef pass = hostProps.get(\"apic.api.pass\")\ndef port = hostProps.get(\"apic.api.port\", \"443\").toInteger()\ndef threads = hostProps.get(\"apic.api.threads\", \"4\").toInteger()\n\n// To run in debug mode, set to true\ndef debug = false\n\n// Get start time for script for threadpool cleanup\nlong startTime = System.currentTimeMillis()\n\ndef modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\ndef lmDebug = modLoader.load(\"lm.debug\", \"0\") // Load LM debug module\ndef lmAPIC = modLoader.load(\"cisco.apic\", \"0\") // Load Cisco APIC module\n\ndef authData =\n[\"aaaUser\":[\"attributes\":[\"name\":\"${user}\",\"pwd\":\"${pass}\"]]]\n\ndef jsonAuth = JsonOutput.toJson(authData)\n\ndef cookie = lmAPIC.getCookie(\"https://${host}:${port}/api/aaaLogin.json\", jsonAuth)\n\n// Get the script timeout and convert to ms\nInteger timeout = Settings.getSetting(\"collector.script.timeout\").toInteger() * 1000\nlmDebug.LMDebugPrint(\"Script timeout set to ${timeout / 1000} seconds\\n\", debug)\n\ndef interfaces = lmAPIC.getData(\"https://${host}:${port}/api/node/class/l1PhysIf.json\", cookie)\ndef threadPool = Executors.newFixedThreadPool(threads)\n\nlmDebug.LMDebugPrint(\"\\nCreating threadpool with ${threads} threads for collecting interface data.\", debug)\n\ntry{\n\tinterfaces['imdata'].each { iface ->\n\t\tthreadPool.submit {\n\t\t\tdef attr = iface.values().first()['attributes']\n\t\t\tdef dn = attr['dn']\n\n\t\t\tdef interfaceStats = lmAPIC.getData(\"https://${host}:${port}/api/node/mo/${attr['dn']}/dbgEtherStats.json\", cookie)\n\n\t\t\tdef imdata = interfaceStats['imdata']\n\n\t\t\tif (imdata)\n\t\t\t{\n\t\t\t\tdef instanceAttr = imdata.first().values().first()['attributes']\n\t\t\t\tlmEmit.dp(dn, \"pkts_broadcast\", instanceAttr['broadcastPkts'])\n\t\t\t\tlmEmit.dp(dn, \"pkts_collision\", instanceAttr['collisions'])\n\t\t\t\tlmEmit.dp(dn, \"pkts_drop\", instanceAttr['dropEvents'])\n\t\t\t\tlmEmit.dp(dn, \"pkts_fragment\", instanceAttr['fragments'])\n\t\t\t\tlmEmit.dp(dn, \"octets\", instanceAttr['octets'])\n\t\t\t\tlmEmit.dp(dn, \"packets\", instanceAttr['pkts'])\n\t\t\t\tlmEmit.dp(dn, \"pkts_error\", instanceAttr['cRCAlignErrors'])\n\t\t\t}\n\n\t\t\tdef interfaceHealth = lmAPIC.getData(\"https://${host}:${port}/api/node/mo/${attr['dn']}.json?query-target=self&rsp-subtree-include=health\", cookie)\n\t\t\tif (interfaceHealth)\n\t\t\t{\n\t\t\t\tdef health = interfaceHealth?.imdata[0]?.l1PhysIf?.children[0].healthInst?.attributes?.cur\n\t\t\t\tlmEmit.dp(attr['dn'], \"health_last\", health)\n\t\t\t}\n\n\t\t} as Callable\n\t}\n}\nfinally\n{\n\t// Initiate an orderly shutdown of the threadpool\n\tthreadPool.shutdown()\n\n\tlong now = System.currentTimeMillis()\n\tlmDebug.LMDebugPrint(\"Current time: ${now}\\t(${now - startTime} ms elapsed)\", debug)\n\n\t// Calculate the remaining execution time\n\tdef remaining = ((timeout - now + startTime) - 5000)\n\tlmDebug.LMDebugPrint(\"Calculated remaining script time as ${remaining / 1000} seconds\", debug)\n\n\t// Block until the script times out or all tasks have finished executing\n\ttry {\n\t\tif (!threadPool.awaitTermination(remaining, TimeUnit.MILLISECONDS)) {\n\t\t\tlmDebug.LMDebugPrint(\"Ran out of time to finish execution, shutting down the rest of the threads\", debug)\n\t\t\t// Force all remaining tasks in the pool to abort\n\t\t\tthreadPool.shutdownNow()\n\t\t}\n\t}\n\tcatch (e) {\n\t\tthreadPool.shutdownNow()\n\t}\n\tlong newNow = System.currentTimeMillis()\n\tlmDebug.LMDebugPrint(\"Shutdown time: ${newNow}\\t(${newNow - startTime} ms elapsed)\", debug)\n}\n\nreturn 0"}, "datapoints": [{"name": "health_last", "description": "The health score in percent of the interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.health_last", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "octets", "description": "Octets per second for the interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.octets", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "packets", "description": "Packets per second for the interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.packets", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pkts_broadcast", "description": "Broadcast packets per second for the interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pkts_broadcast", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pkts_collision", "description": "Collisions per second for the interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pkts_collision", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pkts_drop", "description": "Dropped packets per second for the interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pkts_drop", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pkts_error", "description": "The cyclic redundancy check align errors per second for the interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pkts_error", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "Interface ##INSTANCE## on ##HOST## is discarding ##VALUE## packets/sec due to packet errors, placing the interface into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "pkts_fragment", "description": "Fragmented packets per second for the interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pkts_fragment", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Health Score", "title": "Health Score", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "health_last", "datapointName": "health_last", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Health Score", "color": "silver", "datapointName": "health_last", "isVirtual": false}]}, {"name": "Packet Errors", "title": "Packet Errors", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "pkts_collision", "datapointName": "pkts_collision", "consolidationFn": "average"}, {"name": "pkts_drop", "datapointName": "pkts_drop", "consolidationFn": "average"}, {"name": "pkts_error", "datapointName": "pkts_error", "consolidationFn": "average"}, {"name": "pkts_fragment", "datapointName": "pkts_fragment", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Collisions", "color": "fuchsia", "datapointName": "pkts_collision", "isVirtual": false}, {"type": "line", "legend": "Drops", "color": "yellow", "datapointName": "pkts_drop", "isVirtual": false}, {"type": "line", "legend": "Errors", "color": "red", "datapointName": "pkts_error", "isVirtual": false}, {"type": "line", "legend": "Fragments", "color": "orange2", "datapointName": "pkts_fragment", "isVirtual": false}]}, {"name": "Packet Rate", "title": "Packet Rate", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 40, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "packets", "datapointName": "packets", "consolidationFn": "average"}, {"name": "pkts_broadcast", "datapointName": "pkts_broadcast", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Total Packets", "color": "aqua", "datapointName": "packets", "isVirtual": false}, {"type": "line", "legend": "Broadcast", "color": "blue", "datapointName": "pkts_broadcast", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "octets", "datapointName": "octets", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Bps", "expr": "octets*8"}], "lines": [{"type": "line", "legend": "Throughput (Total throughput in bits/sec)", "color": "olive", "datapointName": "Bps", "isVirtual": true}]}], "overviewGraphs": [{"name": "Top 10 Interfaces by Lowest Health Score", "title": "Top 10 Interfaces by Lowest Health Score", "verticalLabel": "inverse score", "min": 0.0, "max": 100.0, "displayPriority": 30, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "health_last", "datapointName": "health_last", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "inverse", "expr": "100-health_last"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "inverse", "isVirtual": true}]}, {"name": "Top 10 Interfaces by Packet Rate", "title": "Top 10 Interfaces by Packet Rate", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "packets", "datapointName": "packets", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "packets", "isVirtual": false}]}, {"name": "Top 10 Interfaces by Throughput", "title": "Top 10 Interfaces by Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "octets", "datapointName": "octets", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "Bps", "expr": "octets*8"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Bps", "isVirtual": true}]}]}

×DataSource: Ubiquiti_UniFi_Clients_Wired (60)

{"name": "Ubiquiti_UniFi_Clients_Wired", "description": "Monitors the Ubiquiti UniFi connected client throughput and uptime based on the UniFi API.", "appliesTo": "hasCategory(\"Ubiquiti_Unifi\") || (unifi.user && unifi.pass)", "searchKeywords": "access point,ubiquiti,unifi,network,ap", "technicalNotes": "Must define the unifi.user and the unifi.pass in the resource properties for this datasource to apply.\n\nAn optional unifi.port property can be used to specify ports other than 8443.\n\nIf previously relying on https alone to redirect a port other than 8443 please add a unifi.port property to your resources prior to importing versions above 1.7", "displayedAs": "UniFi Clients Wired", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport org.apache.http.HttpEntity\nimport org.apache.http.client.entity.EntityBuilder\nimport org.apache.http.client.methods.CloseableHttpResponse\nimport org.apache.http.client.methods.HttpGet\nimport org.apache.http.client.methods.HttpPost\nimport org.apache.http.client.methods.HttpUriRequest\nimport org.apache.http.conn.ssl.NoopHostnameVerifier\nimport org.apache.http.conn.ssl.TrustSelfSignedStrategy\nimport org.apache.http.impl.client.BasicCookieStore\nimport org.apache.http.impl.client.CloseableHttpClient\nimport org.apache.http.impl.client.HttpClients\nimport org.apache.http.ssl.SSLContextBuilder\n\nimport javax.net.ssl.SSLContext\nimport java.security.cert.CertificateException\nimport java.security.cert.X509Certificate\n\n// To run in debug mode, set to true\ndef debug = false\n\n// Some devices use old API endpoints. We will default to the new one, unless necessary to use the old.\ndef oldAPI = false\n\ndef username = hostProps.get('unifi.user')\ndef password = hostProps.get('unifi.pass')\ndef hostname = hostProps.get('system.hostname')\ndef httpPort = hostProps.get('unifi.port') ?: \"8443\" //optional property for port, defaults to 8443\n\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\n// Default ERI type\ndef defaultERT = \"WiredClient\"\n\n// Reserved MAC addresses not to be mapped, by default restricts OUIs per RFC 5342\ndef reservedAddresses = [\n \"00:00:00\", // ARP\n \"00:00:5e\", // Used for Virtual Router Redundancy Protocol (VRRP) IPV4/6, IANA reserved\n \"01:00:5e\", // Used for IPV4 Multicast and MLPS Multicast\n \"33:33\", // Reserved for IPV6 Multicast\n //\"CF:,\" // Reserved by IANA for PPP(Point to Point Protocol)\n \"02:00:4c:4f:4f:50\",// Microsoft Loopback adapter\n \"20:41:53:59:4e:ff\",// RAS\n \"00-22-BD-F8-19-FF\" // Cisco ACI\n ]\n\n/*****************************************************************************\n * Array of attributes we want to keep from our HTTP response. NOTE: The first\n * element of siteAttrs needs to be 'name' and the first element of clientAttrs\n * needs to be 'mac' because they're used as keys later for iteration.\n *******************************************************************************/\nString[] siteAttrs = ['name', '_id', 'desc']\n\nMap clientAttrsMap = ['mac' : 'network.mac_address',\n 'site_id' : 'site_id',\n 'oui' : 'network.nic_manufacturer',\n 'hostname' : 'os.computer_name',\n 'sw_mac' : 'unifi.client.switch_mac',\n 'sw_port' : 'unifi.client.switch_port',\n 'network' : 'unifi.network_type',\n 'first_seen' : 'unifi.client.first_seen',\n 'is_wired' : 'is_wired',\n 'wired-tx_bytes': 'wired-tx_bytes',\n 'wired-rx_bytes': 'wired-rx_bytes',\n 'is_guest' : 'is_guest']\n\nString[] clientAttrs = clientAttrsMap.keySet()\n\n// Define our endpoints\nloginUrl = \"https://${hostname}:${httpPort}/api/auth/login\"\nsitesUrl = \"https://${hostname}:${httpPort}/proxy/network/api/stat/sites\"\n\n/** Make our request, convert to map, and parse it.\n * Error handling is in the queryMethod.\n * HTTP connection error expected with debug mode set to true when\n * using the old API endpoints as the new API endpoints will fail.\n */\nString response = queryMethod(sitesUrl, loginUrl , password, username, debug)\n\nif (response && response.contains('\"data\":')){\n jsonParsed = (Map) new JsonSlurper().parseText(response)\n}\nelse {\n oldAPI = true\n loginUrl = \"https://${hostname}:${httpPort}/api/login\"\n sitesUrl = \"https://${hostname}:${httpPort}/api/stat/sites\"\n response = queryMethod(sitesUrl, loginUrl , password, username, debug)\n jsonParsed = (Map) new JsonSlurper().parseText(response)\n}\n\nMap sites = responseHandler(jsonParsed.data, siteAttrs)\n\nsites.each{ site_name, site_info ->\n // define our endpoint for each site\n if (oldAPI){\n output_endpoint = \"https://${hostname}:${httpPort}/api/s/${site_name}/stat/sta\"\n }\n else {\n output_endpoint = \"https://${hostname}:${httpPort}/proxy/network/api/s/${site_name}/stat/sta\"\n }\n\n // Make our request, convert to map, and parse it\n // Error handling is in the queryMethod\n String output_response = queryMethod(output_endpoint, loginUrl , password, username, debug)\n Map jsonParsedClient = (Map) new JsonSlurper().parseText(output_response)\n Map clients = responseHandler(jsonParsedClient.data, clientAttrs)\n\n clients.each{ client_mac, client_info ->\n // is it active and is it wired?\n if (client_info['wired-tx_bytes'] || client_info['wired-rx_bytes'])\n {\n // yes\n wildValue = client_mac.replaceAll(':', '')\n if (client_info['hostname'] != null)\n {\n wildAlias = client_info['hostname']\n }\n else if (client_info['name'] != null)\n {\n wildAlias = client_info['name']\n }\n else\n {\n wildAlias = ''\n }\n device_output = \"${wildValue}##${wildAlias} - ${client_mac}##${client_info['oui']}####\"\n client_info.each{ k, v ->\n switch (k)\n {\n case 'is_wired':\n case 'wired-tx_bytes':\n case 'wired-rx_bytes':\n break\n case 'first_seen':\n v = new Date(v.toLong()).format(\"MM/dd/yyyy HH:mm:ss z\")\n default:\n if (v != null)\n {\n device_output += \"auto.${clientAttrsMap[k]}=${v}&\"\n }\n break\n }\n }\n \n if (isMac(client_mac, reservedAddresses, keyBlacklist)) {\n device_output += \"predef.externalResourceID=${eriPreProcessor([client_mac.toLowerCase()], keyNamespace, keyBlacklist)}&\"\n //device_output += \"predef.externalResourceType=${defaultERT}&\"\n }\n\n // Using this to group APs\n println device_output += \"auto.unifi.site=${site_info['desc']}\"\n }\n }\n}\n\n\n// Split query process into a method for easier readability and usage.\ndef queryMethod(String url , String loginUrl, String password , String username, boolean debug = false) {\n //Create a cookie store to support cookies\n BasicCookieStore cookieStore = new BasicCookieStore()\n\n //Create an SSL policy that ignores the certificate\n SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()\n {\n public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException\n {\n return true\n }\n }).build()\n\n // Create an HTTP client\n CloseableHttpClient httpclient = HttpClients.custom()\n .setDefaultCookieStore(cookieStore)\n .setSSLContext(sslContext)\n .setSSLHostnameVerifier(new NoopHostnameVerifier())\n .build()\n\n //Create the body to be posted during login\n HttpEntity entity = EntityBuilder.create()\n .setText(/{\"username\":\"$username\",\"password\":\"$password\"}/)\n .build()\n\n //Create HTTP POST request that will login and obtain a cookie\n HttpPost login = new HttpPost(loginUrl)\n login.setEntity(entity)\n login.setHeader(\"Content-type\", \"application/json\")\n login.setHeader(\"Accept\", \"application/json\")\n\n //Create HTTP GET request that will query the API\n HttpGet query = new HttpGet(url)\n query.setHeader(\"Content-type\", \"application/json\")\n query.setHeader(\"Accept\", \"application/json\")\n\n //Create a closure to make calls and ensure streams get closed\n //The second parameter is a closure, which allows the caller to process output\n Closure httpCall = { HttpUriRequest request, Closure processOutput ->\n CloseableHttpResponse response\n try\n {\n //This simply uses the client to execute the request, and stores the response\n response = httpclient.execute(request)\n\n // processOutput is a closure, so we pass it an argument as we execute it\n // It works exactly like a method in this way\n // This lets the the caller do whatever it wants with the response\n processOutput(response)\n }\n catch (Exception e)\n {\n LMDebugPrint(\"HTTP request failed with error: ${e.message}\", debug)\n throw e\n }\n finally\n {\n if (response)\n {\n response.close()\n }\n }\n }\n\n // Perform the actual calls and make sure the connection gets closed\n String apiReponseText = ''\n try\n {\n //Execute the login call, but do nothing with the response.\n //Cookies from the login are stored automatically\n httpCall(login) {}\n\n //Execute the API query, and assign the text from the response to a variable\n httpCall(query)\n { response ->\n apiReponseText = response.getEntity().getContent().getText()\n return apiReponseText\n }\n }\n catch (Exception e)\n {\n LMDebugPrint(\"HTTP script failed with error: ${e.message}\", debug)\n }\n finally\n {\n httpclient.close()\n }\n}\n\nreturn 0\n\n/********************************************************************************\n * Method to return a map in the form of\n * [map_key: [attr1:val1, attr2:val2, ...], map_key: [attr1:val1, attr2:val2, ...]\n * This is will make it easier to print out all of the values in the main method\n ********************************************************************************/\ndef responseHandler(List<Map<String, String>> responseText, String[] attrs) {\n // Output map to return our maps of attributes for\n // each response we'll parse\n Map output_map = [:]\n\n responseText.collect { item ->\n // Map to store the attributes of this reponse\n Map attr_map = [:]\n attrs.each {\n attr ->\n attr_map[\"${attr}\"] = item[\"${attr}\"]\n }\n // Append the map of this response to output\n output_map.put(item[attrs[0]], attr_map)\n }\n return output_map\n}\n\n// Function to validate a MAC address and filter it out if reserved or blacklisted\ndef isMac(address, reservedAddresses, blacklist) {\n if (address == null) return false\n\n if(blacklist.contains(address)) {\n if(debug) println \"Avoiding ${address} because it is in blacklist\"\n return false\n }\n\n if (address.matches(\"[0-9a-f]{2}([-:]?)[0-9a-f]{2}(\\\\1[0-9a-f]{2}){4}\\$\")) {\n if (!reservedAddresses.find { address.startsWith(it) }) {\n return true\n } else if(debug) println \"Avoiding ${address} because it is in reserved addresses\" \n }\n return false\n}\n\ndef eriPreProcessor(List eriList, String namespace, List blacklist) {\n def output = []\n eriList.each { eri ->\n eri = eri.toLowerCase()\n eri = eri.replace(\",\", \"_\")\n if (!blacklist.contains(eri)) {\n if (namespace) {\n namespace = namespace.replace(\",\", \"_\").replace(\"&\", \"and\")\n eri = \"${namespace}::${eri}\"\n }\n output << eri\n }\n }\n return output.join(\",\")\n}\n\n/**\n * Helper function to print out debug messages for troubleshooting purposes.\n */\ndef LMDebugPrint(message, boolean debug) {\n if (debug) {\n println(message.toString())\n }\n}"}, "groupMethod": "ilp", "groupExpr": "auto.unifi.site"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport org.apache.http.HttpEntity\nimport org.apache.http.client.entity.EntityBuilder\nimport org.apache.http.client.methods.CloseableHttpResponse\nimport org.apache.http.client.methods.HttpGet\nimport org.apache.http.client.methods.HttpPost\nimport org.apache.http.client.methods.HttpUriRequest\nimport org.apache.http.conn.ssl.NoopHostnameVerifier\nimport org.apache.http.conn.ssl.TrustSelfSignedStrategy\nimport org.apache.http.impl.client.BasicCookieStore\nimport org.apache.http.impl.client.CloseableHttpClient\nimport org.apache.http.impl.client.HttpClients\nimport org.apache.http.ssl.SSLContextBuilder\n\nimport javax.net.ssl.SSLContext\nimport java.security.cert.CertificateException\nimport java.security.cert.X509Certificate\n\n// To run in debug mode, set to true\ndef debug = false\n\n// Some devices use old API endpoints. We will default to the new one, unless necessary to use the old.\ndef oldAPI = false\n\ndef username = hostProps.get('unifi.user')\ndef password = hostProps.get('unifi.pass')\ndef hostname = hostProps.get('system.hostname')\ndef httpPort = hostProps.get('unifi.port') ?: \"8443\" //optional property for port, defaults to 8443\n\n/*****************************************************************************\n * Array of attributes we want to keep from our HTTP response. NOTE: The first\n * element of siteAttrs needs to be 'name' and the first element of clientAttrs\n * needs to be 'mac' because they're used as keys later for iteration.\n *******************************************************************************/\nString[] siteAttrs = ['name', '_id']\nString[] clientAttrs = ['mac',\n 'wired-tx_bytes',\n 'wired-rx_bytes',\n 'wired-tx_packets',\n 'wired-rx_packets',\n '_uptime_by_usw']\n\n\n// Make our request, convert to map, and parse it\n// Error handling is in the queryMethod\nloginUrl = \"https://${hostname}:${httpPort}/api/auth/login\"\nsitesUrl = \"https://${hostname}:${httpPort}/proxy/network/api/stat/sites\"\n\n/** Make our request, convert to map, and parse it.\n * Error handling is in the queryMethod.\n * HTTP connection error expected with debug mode set to true when\n * using the old API endpoints as the new API endpoints will fail.\n */\nString response = queryMethod(sitesUrl, loginUrl , password, username, debug)\n\nif (response && response.contains('\"data\":')){\n jsonParsed = (Map) new JsonSlurper().parseText(response)\n}\nelse {\n oldAPI = true\n loginUrl = \"https://${hostname}:${httpPort}/api/login\"\n sitesUrl = \"https://${hostname}:${httpPort}/api/stat/sites\"\n response = queryMethod(sitesUrl, loginUrl , password, username, debug)\n jsonParsed = (Map) new JsonSlurper().parseText(response)\n}\n\nMap sites = responseHandler(jsonParsed.data, siteAttrs)\n\nsites.each{ site_name, site_info ->\n // define our endpoint for each site\n if (oldAPI){\n output_endpoint = \"https://${hostname}:${httpPort}/api/s/${site_name}/stat/sta\"\n }\n else {\n output_endpoint = \"https://${hostname}:${httpPort}/proxy/network/api/s/${site_name}/stat/sta\"\n }\n\n // Make our request, convert to map, and parse it\n // Error handling is in the queryMethod\n String output_response =queryMethod(output_endpoint, loginUrl , password, username, debug)\n Map jsonParsedClient = (Map) new JsonSlurper().parseText(output_response)\n Map clients = responseHandler(jsonParsedClient.data, clientAttrs)\n\n clients.each{ client_mac, client_info ->\n // is it active and is it wired?\n if (client_info['wired-tx_bytes'] || client_info['wired-rx_bytes'])\n {\n client_info.each{ k, v ->\n println \"${client_mac.replaceAll(':', '')}.${k}=${v}\"\n }\n }\n }\n}\n\nreturn 0\n\n\n// Split query process into a method for easier readability and usage.\ndef queryMethod(String url , String loginUrl, String password , String username, boolean debug = false) {\n //Create a cookie store to support cookies\n BasicCookieStore cookieStore = new BasicCookieStore()\n\n //Create an SSL policy that ignores the certificate\n SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()\n {\n public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException\n {\n return true\n }\n }).build()\n\n // Create an HTTP client\n CloseableHttpClient httpclient = HttpClients.custom()\n .setDefaultCookieStore(cookieStore)\n .setSSLContext(sslContext)\n .setSSLHostnameVerifier(new NoopHostnameVerifier())\n .build()\n\n //Create the body to be posted during login\n HttpEntity entity = EntityBuilder.create()\n .setText(/{\"username\":\"$username\",\"password\":\"$password\"}/)\n .build()\n\n //Create HTTP POST request that will login and obtain a cookie\n HttpPost login = new HttpPost(loginUrl)\n login.setEntity(entity)\n login.setHeader(\"Content-type\", \"application/json\")\n login.setHeader(\"Accept\", \"application/json\")\n\n //Create HTTP GET request that will query the API\n HttpGet query = new HttpGet(url)\n query.setHeader(\"Content-type\", \"application/json\")\n query.setHeader(\"Accept\", \"application/json\")\n\n //Create a closure to make calls and ensure streams get closed\n //The second parameter is a closure, which allows the caller to process output\n Closure httpCall = { HttpUriRequest request, Closure processOutput ->\n CloseableHttpResponse response\n try\n {\n //This simply uses the client to execute the request, and stores the response\n response = httpclient.execute(request)\n\n // processOutput is a closure, so we pass it an argument as we execute it\n // It works exactly like a method in this way\n // This lets the the caller do whatever it wants with the response\n processOutput(response)\n }\n catch (Exception e)\n {\n LMDebugPrint(\"HTTP request failed with error: ${e.message}\", debug)\n throw e\n }\n finally\n {\n if (response)\n {\n response.close()\n }\n }\n }\n\n // Perform the actual calls and make sure the connection gets closed\n String apiReponseText = ''\n try\n {\n //Execute the login call, but do nothing with the response.\n //Cookies from the login are stored automatically\n httpCall(login) {}\n\n //Execute the API query, and assign the text from the response to a variable\n httpCall(query)\n { response ->\n apiReponseText = response.getEntity().getContent().getText()\n return apiReponseText\n }\n }\n catch (Exception e)\n {\n LMDebugPrint(\"HTTP script failed with error: ${e.message}\", debug)\n }\n finally\n {\n httpclient.close()\n }\n}\n\n/********************************************************************************\n * Method to return a map in the form of\n * [map_key: [attr1:val1, attr2:val2, ...], map_key: [attr1:val1, attr2:val2, ...]\n * This is will make it easier to print out all of the values in the main method\n ********************************************************************************/\ndef responseHandler(List<Map<String, String>> responseText, String[] attrs) {\n // Output map to return our maps of attributes for\n // each response we'll parse\n Map output_map = [:]\n\n responseText.collect{ item ->\n // Map to store the attributes of this reponse\n Map attr_map = [:]\n attrs.each{ attr ->\n attr_map[\"${attr}\"] = item[\"${attr}\"]\n }\n // Append the map of this response to output\n output_map.put(item[attrs[0]], attr_map)\n }\n return output_map\n}\n\n/**\n * Helper function to print out debug messages for troubleshooting purposes.\n */\ndef LMDebugPrint(message, boolean debug) {\n if (debug) {\n println(message.toString())\n }\n}"}, "datapoints": [{"name": "RxBytes", "description": "Bytes/sec received from the client device.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.wired-rx_bytes", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RxPackets", "description": "Packets/sec received from the client device.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.wired-rx_packets", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TxBytes", "description": "Bytes/sec transmitted from the client device.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.wired-tx_bytes", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TxPackets", "description": "Packets/sec transmitted from the client device.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.wired-tx_packets", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UptimeSeenBySwitch", "description": "The uptime of the device as seen by the switch in seconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##._uptime_by_usw", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Packet Transmission Rate", "title": "Packet Transmission Rate", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "RxPackets", "datapointName": "RxPackets", "consolidationFn": "average"}, {"name": "TxPackets", "datapointName": "TxPackets", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Inbound Packets", "color": "blue", "datapointName": "RxPackets", "isVirtual": false}, {"type": "stack", "legend": "Outbound Packets", "color": "green", "datapointName": "TxPackets", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "RxBytes", "datapointName": "RxBytes", "consolidationFn": "average"}, {"name": "TxBytes", "datapointName": "TxBytes", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "RxBits", "expr": "RxBytes*8"}, {"name": "TxBits", "expr": "TxBytes*8"}], "lines": [{"type": "stack", "legend": "Inbound", "color": "silver", "datapointName": "RxBits", "isVirtual": true}, {"type": "stack", "legend": "Outbound", "color": "green", "datapointName": "TxBits", "isVirtual": true}]}, {"name": "Uptime Seen By Switch", "title": "Uptime Seen By Switch", "verticalLabel": "days", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "UptimeSeenBySwitch", "datapointName": "UptimeSeenBySwitch", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "UptimeDays", "expr": "UptimeSeenBySwitch/60/60/24"}], "lines": [{"type": "line", "legend": "Uptime Seen By Switch", "color": "black", "datapointName": "UptimeDays", "isVirtual": true}]}], "overviewGraphs": [{"name": "Top 10 Most Active Wired Clients", "title": "Top 10 Most Active Wired Clients", "verticalLabel": "bps", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "RxBytes", "datapointName": "RxBytes", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "TxBytes", "datapointName": "TxBytes", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "Throughput", "expr": "(RxBytes+TxBytes)*8"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Throughput", "isVirtual": true}]}]}

×DataSource: Raritan_PowerDistribution_Inlets (1460)

{"name": "Raritan_PowerDistribution_Inlets", "description": "Monitors Raritan power distribution inlet power statistics and operating states.", "appliesTo": "hasCategory(\"RaritanPdu2\")", "searchKeywords": "pdu,pdu2-mib,px2,raritan", "technicalNotes": "Retrieves statistics related to the inlets on Raritan gen2 devices that respond to the PDU2-MIB (i.e. .1.3.6.1.4.1.13742.6)", "displayedAs": "Raritan Inlets", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get(\"system.hostname\")\ndef props = hostProps.toProperties()\ndef timeout = 100000\n\noutletStats = Snmp.walkAsMap(host, \".1.3.6.1.4.1.13742.6.3.3.3.1.2\", props, timeout)\n\noutletStats.each {\n oidIndex, value ->\n def pduId = oidIndex.tokenize(\".\")[0]\n def outletId = oidIndex.tokenize(\".\")[1]\n\n println \"${pduId}-${outletId}##PDU ${pduId} - Inlet ${outletId}######auto.pdu.id=PDU${pduId}\"\n}\n\nreturn 0"}, "groupMethod": "ilp", "groupExpr": "auto.pdu.id"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get(\"system.hostname\")\ndef props = hostProps.toProperties()\ndef timeout = 100000\n\noutletStats = Snmp.walkAsMap(host, \".1.3.6.1.4.1.13742.6.5.2.3.1\", props, timeout)\noutletStatScale = Snmp.walkAsMap(host, \".1.3.6.1.4.1.13742.6.3.3.4.1.7\", props, timeout)\n\noutletStats.each {\n oidIndex, value ->\n\n measurementType = oidIndex.tokenize('.')[0]\n pduId = oidIndex.tokenize('.')[1]\n outletId = oidIndex.tokenize('.')[2]\n sensorKey = oidIndex.tokenize('.')[3]\n\n def scaleFactor = outletStatScale.find { it.key == \"${pduId}.${outletId}.${sensorKey}\" }?.value.toInteger()\n availabilityHandler(measurementType, pduId, outletId, sensorKey, value.toFloat(), scaleFactor)\n}\n\nreturn 0\n\ndef availabilityHandler(String measurementType, String pduId, String outletId, String sensorKey, Float value, Integer scaleFactor) {\n\n sensorMap = [1 : 'rmsCurrent',\n 4 : 'rmsvoltage',\n 5 : 'activePower',\n 6 : 'apparentPower',\n 8 : 'activeEnergy',\n 23: 'frequency']\n\n if (sensorMap.containsKey(sensorKey.toInteger())) {\n switch (measurementType) {\n case '2':\n println \"${pduId}-${outletId}.${sensorMap[sensorKey.toInteger()]}Availability=${value}\"\n break\n case '3':\n println \"${pduId}-${outletId}.${sensorMap[sensorKey.toInteger()]}State=${value}\"\n break\n case '4':\n if (scaleFactor != 0) {\n value /= 10.power(scaleFactor)\n }\n println \"${pduId}-${outletId}.${sensorMap[sensorKey.toInteger()]}=${value}\"\n break\n }\n\n }\n}"}, "datapoints": [{"name": "activeEnergy", "description": "Active energy measure in Watt-Hours.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activeEnergy", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "activeEnergyAvailability", "description": "Returns 1 if the active energy sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activeEnergyAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "activeEnergyState", "description": "The state of the active energy sensor.\n\nStatus Codes:\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activeEnergyState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "6", "threshold": "!= 4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Inlet ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the active energy state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "activePower", "description": "A unique value for the active power sensor attached to the outlet in Watts.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activePower", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "activePowerAvailability", "description": "Returns 1 if the active power sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activePowerAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "activePowerState", "description": "Status code enumerating the active power state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activePowerState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "6", "threshold": "!= 4", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Inlet ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the active power state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "apparentPower", "description": "A unique value for the apparent power sensor attached to the outlet in Volt-Amps (VA).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.apparentPower", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "apparentPowerAvailability", "description": "Returns 1 if the apparent power sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.apparentPowerAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "apparentPowerState", "description": "Status code enumerating the apparent power state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.apparentPowerState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "6", "threshold": "!= 4", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Inlet ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the apparent power state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "frequency", "description": "The AC frequency of the inlet.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.frequency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "frequencyAvailability", "description": "Returns 1 if the frequency sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.frequencyAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "frequencyState", "description": "Status code enumerating the AC frequency state of the outlet.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.frequencyState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "6", "threshold": "!= 4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Inlet ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the AC frequency state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "rmsCurrent", "description": "A unique value for the current sensor attached to the outlet in amps.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rmsCurrent", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rmsCurrentAvailability", "description": "Returns 1 if the rms current sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rmsCurrentAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rmsCurrentState", "description": "Status code enumerating the RMS current state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rmsCurrentState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "6", "threshold": "!= 4", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Inelt ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the rms current state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "rmsVoltage", "description": "A unique value for the voltage sensor attached to the outlet in Volts.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rmsVoltage", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rmsVoltageAvailability", "description": "Returns 1 if the rms voltage sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rmsVoltageAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rmsVoltageState", "description": "Status code enumerating the RMS voltage state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rmsVoltageState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "316", "threshold": "!= 4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Inlet ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the rms voltage state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "AC Frequency", "title": "AC Frequency", "verticalLabel": "hertz", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "frequency", "datapointName": "frequency", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "frequency", "color": "blue", "datapointName": "frequency", "isVirtual": false}]}, {"name": "Active Energy", "title": "Active Energy", "verticalLabel": "watt-hours", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "activeEnergy", "datapointName": "activeEnergy", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Active Energy", "color": "lime", "datapointName": "activeEnergy", "isVirtual": false}]}, {"name": "Active Power", "title": "Active Power", "verticalLabel": "watts", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "activePower", "datapointName": "activePower", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Active Power", "color": "red", "datapointName": "activePower", "isVirtual": false}]}, {"name": "Apparent Power", "title": "Apparent Power", "verticalLabel": "volt-amps", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "apparentPower", "datapointName": "apparentPower", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Apparent Power", "color": "orange", "datapointName": "apparentPower", "isVirtual": false}]}, {"name": "RMS Current", "title": "RMS Current", "verticalLabel": "amps", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "rmsCurrent", "datapointName": "rmsCurrent", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "RMS Current", "color": "silver", "datapointName": "rmsCurrent", "isVirtual": false}]}, {"name": "RMS Voltage", "title": "RMS Voltage", "verticalLabel": "volts", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "rmsVoltage", "datapointName": "rmsVoltage", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "RMS Voltage", "color": "silver", "datapointName": "rmsVoltage", "isVirtual": false}]}, {"name": "Sensor Availability", "title": "Sensor Availability", "verticalLabel": "0=unavailable, 1=available", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "activeEnergyAvailability", "datapointName": "activeEnergyAvailability", "consolidationFn": "average"}, {"name": "activePowerAvailability", "datapointName": "activePowerAvailability", "consolidationFn": "average"}, {"name": "apparentPowerAvailability", "datapointName": "apparentPowerAvailability", "consolidationFn": "average"}, {"name": "frequencyAvailability", "datapointName": "frequencyAvailability", "consolidationFn": "average"}, {"name": "rmsCurrentAvailability", "datapointName": "rmsCurrentAvailability", "consolidationFn": "average"}, {"name": "rmsVoltageAvailability", "datapointName": "rmsVoltageAvailability", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Active Energy Sensor", "color": "blue", "datapointName": "activeEnergyAvailability", "isVirtual": false}, {"type": "line", "legend": "Active Power Sensor", "color": "olive", "datapointName": "activePowerAvailability", "isVirtual": false}, {"type": "line", "legend": "Apparent Power Sensor", "color": "red2", "datapointName": "apparentPowerAvailability", "isVirtual": false}, {"type": "line", "legend": "Frequency Sensor", "color": "orange", "datapointName": "frequencyAvailability", "isVirtual": false}, {"type": "line", "legend": "RMS Current Sensor", "color": "silver", "datapointName": "rmsCurrentAvailability", "isVirtual": false}, {"type": "line", "legend": "RMS Voltage Sensor", "color": "fuchsia", "datapointName": "rmsVoltageAvailability", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Inlets With The Highest Current Consumption", "title": "Top 10 Inlets With The Highest Current Consumption", "verticalLabel": "amps", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "rmsCurrent", "datapointName": "rmsCurrent", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "rmsCurrent", "isVirtual": false}]}, {"name": "Top 10 Inlets With The Highest Power Consumption", "title": "Top 10 Inlets With The Highest Power Consumption", "verticalLabel": "watts", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "activePower", "datapointName": "activePower", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "activePower", "isVirtual": false}]}]}

×DataSource: Raritan_PowerDistribution_Outlets (1459)

{"name": "Raritan_PowerDistribution_Outlets", "description": "Monitors Raritan power distribution outlet power statistics and operating states.", "appliesTo": "hasCategory(\"RaritanPdu2\")", "searchKeywords": "pdu,pdu2-mib,px2,raritan", "technicalNotes": "Retrieves statistics related to the outlets on Raritan gen2 devices that respond to the PDU2-MIB (i.e. .1.3.6.1.4.1.13742.6)", "displayedAs": "Raritan Outlets", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get(\"system.hostname\")\ndef props = hostProps.toProperties()\ndef timeout = 100000\n\noutletStats = ifEntry = Snmp.walkAsMap(host, \".1.3.6.1.4.1.13742.6.3.5.3.1.2\", props, timeout)\n\noutletStats.each {\n oidIndex, value ->\n def pduId = oidIndex.tokenize(\".\")[0]\n def outletId = oidIndex.tokenize(\".\")[1]\n\n println \"${pduId}-${outletId}##PDU ${pduId} - Outlet ${outletId}######auto.pdu.id=PDU${pduId}\"\n}\n\nreturn 0"}, "groupMethod": "ilp", "groupExpr": "auto.pdu.id"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get(\"system.hostname\")\ndef props = hostProps.toProperties()\ndef timeout = 100000\n\noutletStats = Snmp.walkAsMap(host, \".1.3.6.1.4.1.13742.6.5.4.3.1\", props, timeout)\noutletStatScale = Snmp.walkAsMap(host, \".1.3.6.1.4.1.13742.6.3.5.4.1.7\", props, timeout)\n\noutletStats.each {\n oidIndex, value ->\n\n measurementType = oidIndex.tokenize('.')[0]\n pduId = oidIndex.tokenize('.')[1]\n outletId = oidIndex.tokenize('.')[2]\n sensorKey = oidIndex.tokenize('.')[3]\n\n def scaleFactor = outletStatScale.find { it.key == \"${pduId}.${outletId}.${sensorKey}\" }?.value.toInteger()\n availabilityHandler(measurementType, pduId, outletId, sensorKey, value.toFloat(), scaleFactor)\n}\n\nreturn 0\n\ndef availabilityHandler(String measurementType, String pduId, String outletId, String sensorKey, Float value, Integer scaleFactor) {\n\n sensorMap = [1 : 'rmsCurrent',\n 4 : 'rmsvoltage',\n 5 : 'activePower',\n 6 : 'apparentPower',\n 8 : 'activeEnergy',\n 14: 'onOff',\n 23: 'frequency']\n\n if (sensorMap.containsKey(sensorKey.toInteger())) {\n switch (measurementType) {\n case '2':\n println \"${pduId}-${outletId}.${sensorMap[sensorKey.toInteger()]}Availability=${value}\"\n break\n case '3':\n println \"${pduId}-${outletId}.${sensorMap[sensorKey.toInteger()]}State=${value}\"\n break\n case '4':\n if (scaleFactor != 0) {\n value /= 10.power(scaleFactor)\n }\n println \"${pduId}-${outletId}.${sensorMap[sensorKey.toInteger()]}=${value}\"\n break\n }\n\n }\n}"}, "datapoints": [{"name": "activeEnergy", "description": "Active energy measure in Watt-Hours.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activeEnergy", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "activeEnergyAvailability", "description": "Returns 1 if the active energy sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activeEnergyAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "activeEnergyState", "description": "The state of the active energy sensor.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activeEnergyState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "6", "threshold": "!= 4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Outlet ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the active energy state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "activePower", "description": "A unique value for the active power sensor attached to the outlet in Watts.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activePower", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "activePowerAvailability", "description": "Returns 1 if the active power sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activePowerAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "activePowerState", "description": "Status code enumerating the active power state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activePowerState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "6", "threshold": "!= 4", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Outlet ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the active power state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "apparentPower", "description": "A unique value for the apparent power sensor attached to the outlet in Volt-Amps (VA).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.apparentPower", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "apparentPowerAvailability", "description": "Returns 1 if the apparent power sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.apparentPowerAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "apparentPowerState", "description": "Status code enumerating the apparent power state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.apparentPowerState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "6", "threshold": "!= 4", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Outlet ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the apparent power state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "frequency", "description": "The AC frequency of the outlet.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.frequency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "frequencyAvailability", "description": "Returns 1 if the frequency sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.frequencyAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "frequencyState", "description": "Status code enumerating the AC frequency state of the outlet.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.frequencyState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "6", "threshold": "!= 4", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Outlet ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the AC frequency state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "onOff", "description": "The value of the on/off sensor.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.onOff", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "onOffAvailability", "description": "Returns 1 if the on/off sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.onOffAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "onOffState", "description": "The state of the on/off sensor.\n\nStatus Codes:\n\n-1=unavailable,\n7=on,\n8=off", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.onOffState", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "= -1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Outlet ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the on/off sensor state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n7=on,\n8=off\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "rmsCurrent", "description": "A unique value for the current sensor attached to the outlet in amps.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rmsCurrent", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rmsCurrentAvailability", "description": "Returns 1 if the rms current sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rmsCurrentAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rmsCurrentState", "description": "Status code enumerating the RMS current state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rmsCurrentState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "6", "threshold": "!= 4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 2, "alertBody": "Outlet ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the rms current state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "rmsVoltage", "description": "A unique value for the voltage sensor attached to the outlet in Volts.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rmsVoltage", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rmsVoltageAvailability", "description": "Returns 1 if the rms voltage sensor is available, else returns a 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rmsVoltageAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "rmsVoltageState", "description": "Status code enumerating the RMS voltage state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rmsVoltageState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "6", "threshold": "!= 4", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Outlet ##INSTANCE## on Raritan PDU ##HOST## is reporting a status code of ##VALUE## for the rms voltage state putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n2=belowLowerCritical,\n3=belowLowerWarning,\n4=normal,\n5=aboveUpperWarning,\n6=aboveUpperCritical\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "AC Frequency", "title": "AC Frequency", "verticalLabel": "hertz", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "frequency", "datapointName": "frequency", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Outlet AC Frequency", "color": "olive", "datapointName": "frequency", "isVirtual": false}]}, {"name": "Active Energy", "title": "Active Energy", "verticalLabel": "watt-hours", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "activeEnergy", "datapointName": "activeEnergy", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Active Energy", "color": "olive", "datapointName": "activeEnergy", "isVirtual": false}]}, {"name": "Active Power", "title": "Active Power", "verticalLabel": "watts", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "activePower", "datapointName": "activePower", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Active Power", "color": "red", "datapointName": "activePower", "isVirtual": false}]}, {"name": "Apparent Power", "title": "Apparent Power", "verticalLabel": "volt-amps", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "apparentPower", "datapointName": "apparentPower", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Apparent Power", "color": "orange", "datapointName": "apparentPower", "isVirtual": false}]}, {"name": "RMS Current", "title": "RMS Current", "verticalLabel": "amps", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "rmsCurrent", "datapointName": "rmsCurrent", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "RMS Current", "color": "silver", "datapointName": "rmsCurrent", "isVirtual": false}]}, {"name": "RMS Voltage", "title": "RMS Voltage", "verticalLabel": "volts", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "rmsVoltage", "datapointName": "rmsVoltage", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "RMS Voltage", "color": "silver", "datapointName": "rmsVoltage", "isVirtual": false}]}, {"name": "Remote Outlet Switching Status", "title": "Remote Outlet Switching Status", "verticalLabel": "0=on", "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "onOff", "datapointName": "onOff", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Remote Outlet Switching Status", "color": "lime", "datapointName": "onOff", "isVirtual": false}]}, {"name": "Sensor Availability", "title": "Sensor Availability", "verticalLabel": "0=unavailable, 1=available", "min": -1.0, "max": 2.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "activeEnergyAvailability", "datapointName": "activeEnergyAvailability", "consolidationFn": "average"}, {"name": "activePowerAvailability", "datapointName": "activePowerAvailability", "consolidationFn": "average"}, {"name": "apparentPowerAvailability", "datapointName": "apparentPowerAvailability", "consolidationFn": "average"}, {"name": "frequencyAvailability", "datapointName": "frequencyAvailability", "consolidationFn": "average"}, {"name": "onOffAvailability", "datapointName": "onOffAvailability", "consolidationFn": "average"}, {"name": "rmsCurrentAvailability", "datapointName": "rmsCurrentAvailability", "consolidationFn": "average"}, {"name": "rmsVoltageAvailability", "datapointName": "rmsVoltageAvailability", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Active Energy Sensor", "color": "blue", "datapointName": "activeEnergyAvailability", "isVirtual": false}, {"type": "line", "legend": "Active Power Sensor", "color": "olive", "datapointName": "activePowerAvailability", "isVirtual": false}, {"type": "line", "legend": "Apparent Power Sensor", "color": "red", "datapointName": "apparentPowerAvailability", "isVirtual": false}, {"type": "line", "legend": "Frequency Sensor", "color": "orange", "datapointName": "frequencyAvailability", "isVirtual": false}, {"type": "line", "legend": "On-Off Sensor", "color": "yellow", "datapointName": "onOffAvailability", "isVirtual": false}, {"type": "line", "legend": "RMS Current Sensor", "color": "fuchsia", "datapointName": "rmsCurrentAvailability", "isVirtual": false}, {"type": "line", "legend": "RMS Voltage Sensor", "color": "gray", "datapointName": "rmsVoltageAvailability", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Outlets With The Highest Current Consumption", "title": "Top 10 Outlets With The Highest Current Consumption", "verticalLabel": "amps", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "rmsCurrent", "datapointName": "rmsCurrent", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "rmsCurrent", "isVirtual": false}]}, {"name": "Top 10 Outlets With The Highest Power Consumption", "title": "Top 10 Outlets With The Highest Power Consumption", "verticalLabel": "watts", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "activePower", "datapointName": "activePower", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "activePower", "isVirtual": false}]}]}

×DataSource: Raritan_PowerDistribution_Unit (1600)

{"name": "Raritan_PowerDistribution_Unit", "description": "Monitors Raritan global unit operating status and availability.", "appliesTo": "hasCategory(\"RaritanPdu2\")", "searchKeywords": "pdu,pdu2-mib,raritan,power supply", "technicalNotes": "- Retrieves statistics related to the power supply unit sensor on Raritan gen2 devices that respond to the PDU2-MIB (i.e. .1.3.6.1.4.1.13742.6)\n\n- If there is only one power supply, the i2smpsStatus datapoints will return no data. You will not receive an alert for these unless there is a second power supply and it is in a fault or unavailable state.", "displayedAs": "Raritan Unit", "collectionInterval": "2m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get(\"system.hostname\")\ndef props = hostProps.toProperties()\ndef timeout = 100000\n\nunitInfo = Snmp.walkAsMap(host, \".1.3.6.1.4.1.13742.6.3.2.1.1\", props, timeout)\n\n\ninstancesMap = mapHandler(unitInfo)\n\ninstancesMap.each {\n instance, valueMap ->\n println \"${instance}##${instance}\"\n}\n\nreturn 0\n\ndef mapHandler(HashMap propMap) {\n // Empty map to store our ouput\n Map outputArray = [:]\n propMap.each {\n indexOid, value ->\n // Separate our indexes\n def counter_index = indexOid.tokenize(\".\")[0]\n def index = indexOid.tokenize(\".\")[1]\n\n if (!outputArray[index]) {\n outputArray[index] = [:]\n }\n\n outputArray[index] += [(counter_index): value]\n }\n return outputArray\n}\n"}, "groupMethod": "ilp", "groupExpr": "auto.pdu.id"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get(\"system.hostname\")\ndef props = hostProps.toProperties()\ndef timeout = 100000\n\nunitStats = Snmp.walkAsMap(host, \".1.3.6.1.4.1.13742.6.5.1.3.1\", props, timeout)\nunitScale = Snmp.walkAsMap(host, \".1.3.6.1.4.1.13742.6.3.2.5.1.7\", props, timeout)\n\nunitStats.each {\n oidIndex, value ->\n\n measurementType = oidIndex.tokenize('.')[0]\n pduId = oidIndex.tokenize('.')[1]\n sensorKey = oidIndex.tokenize('.')[2]\n\n def scaleFactor = unitScale.find { it.key == \"${pduId}.${sensorKey}\" }?.value.toInteger()\n unitHandler(measurementType, pduId, sensorKey, value.toFloat(), scaleFactor)\n}\n\nreturn 0\n\ndef unitHandler(String measurementType, String pduId, String sensorKey, Float value, Integer scaleFactor) {\n\n sensorMap = [46: 'i1smpsStatus',\n 47: 'i2smpsStatus']\n\n if (sensorMap.containsKey(sensorKey.toInteger())) {\n switch (measurementType) {\n case '2':\n println \"${pduId}.${sensorMap[sensorKey.toInteger()]}Availability=${value}\"\n break\n case '3':\n println \"${pduId}.${sensorMap[sensorKey.toInteger()]}=${value}\"\n break\n }\n }\n\n}"}, "datapoints": [{"name": "i1smpsStatus", "description": "Status code enumerating the state of the first switched mode power supply.\n\nStatus Codes:\n\n-1=unavailable,\n12=OK,\n26=fault", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.i1smpsStatus", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "26", "threshold": "!= 12", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The switched-mode power supply (smps1), ##INSTANCE##, on Raritan PDU unit ##HOST## is reporting a status code of ##VALUE## for the smps1 sensor, putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n12=OK,\n26=fault\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "i1smpsStatusAvailability", "description": "Availability of switched mode power supply sensor.\n\nStatus codes:\n0=unavailable\n1=available", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.i1smpsStatusAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "i2smpsStatus", "description": "Status code enumerating the state of the second switched mode power supply.\n\nStatus Codes:\n\n-1=unavailable,\n12=OK,\n26=fault\n\nNo data for this means that the second power supply does not exist on the unit.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.i2smpsStatus", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "26", "threshold": "!= 12", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The second switched-mode power supply (smps2), ##INSTANCE##, on Raritan PDU unit ##HOST## is reporting a status code of ##VALUE## for the smps2 sensor, putting the host into a ##LEVEL## state.\n\nStatus Codes:\n\n-1=unavailable,\n12=OK,\n26=fault\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "i2smpsStatusAvailability", "description": "Availability of the second switched mode power supply sensor. No data for this datapoint means the second power supply is not physically on the model being monitored.\n\nStatus codes:\n0=unavailable\n1=available", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.i2smpsStatusAvailability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Power Supply Status Sensor Availability", "title": "Power Supply Status Sensor Availability", "verticalLabel": "0=unavailable, 1=available", "min": -1.0, "max": 2.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "i1smpsStatusAvailability", "datapointName": "i1smpsStatusAvailability", "consolidationFn": "average"}, {"name": "i2smpsStatusAvailability", "datapointName": "i2smpsStatusAvailability", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Power Supply 1 Sensor Availability", "color": "silver", "datapointName": "i1smpsStatusAvailability", "isVirtual": false}, {"type": "line", "legend": "Power Supply 2 Sensor Availability", "color": "lime", "datapointName": "i2smpsStatusAvailability", "isVirtual": false}]}, {"name": "Unit Status", "title": "Unit Status", "verticalLabel": "-1=unavailable,12=ok, 26=fault", "min": -2.0, "max": 27.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "i1smpsStatus", "datapointName": "i1smpsStatus", "consolidationFn": "average"}, {"name": "i2smpsStatus", "datapointName": "i2smpsStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Power Supply 1 Availability", "color": "silver", "datapointName": "i1smpsStatus", "isVirtual": false}, {"type": "line", "legend": "Power Supply 2 Availability", "color": "lime", "datapointName": "i2smpsStatus", "isVirtual": false}]}]}

×DataSource: Viptela_BGP_Neighbors (1589)

{"name": "Viptela_BGP_Neighbors", "description": "Monitor Viptela BGP neighbors including status and traffic statistics.", "appliesTo": "hasCategory(\"Viptela_vEdge\") || hasCategory(\"Viptela_vSmart\") || hasCategory(\"Viptela_vManage\") || hasCategory(\"Viptela_vBond\")", "searchKeywords": "sdwan,bgp,networking,viptela", "technicalNotes": "- ensure SNMP is configured.", "displayedAs": "Viptela BGP Neighbors", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get(\"system.hostname\")\ndef timeout = 25000\ndef props = hostProps.toProperties()\n\n// Commented ILPs are in MIB but haven't been returned on any tested devices\nilpMap = [\n '1' : 'vpnid',\n '3' : 'as',\n '4' : 'localasnum',\n//'5' : 'changelocalasnum',\n//'6' : 'flags',\n '8' : 'remoterouterid',\n//'9' : 'commonadmin',\n '11': 'keepalive',\n '12': 'holdtime',\n '13': 'cfgkeepalive',\n '14': 'cfgholdtime',\n '15': 'adv4byteascap',\n '16': 'rec4byteascap',\n//'17' : 'advdynamiccap',\n//'18' : 'recdynamiccap',\n '19': 'advrefreshcap',\n '20': 'recrefreshcap',\n//'21' : 'advnewrefreshcap',\n '22': 'recnewrefreshcap',\n//'23' : 'advipv4unicastaddrfamily',\n//'24' : 'recipv4unicastaddrfamily',\n '47': 'advinterval',\n//'48' : 'updatesource',\n//'49' : 'updateif',\n//'50' : 'weight',\n '51': 'connestablished',\n '52': 'conndropped',\n//'55' : 'MaxPrefixRestartTime',\n//'56' : 'ExtPeerHops',\n '57': 'LocalHost',\n '58': 'localport',\n '59': 'remotehost',\n '60': 'remoteport',\n '61': 'nexthop',\n//'62' : 'nextstarttimer',\n//'63' : 'nextconnecttimer',\n '64': 'ReadThreadOn',\n//'65' : 'writethreadon',\n '67': 'lastuptime'\n]\n\nneighbors = walkHandler(Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.14.9.1\", props, timeout))\n\nneighbors.each\n {\n neighbor, ilps ->\n def wildalias = ilps['remotehost']\n println \"${neighbor}##${wildalias}######${ilps.collect { \"auto.viptela.bgpneighbor.${it}\" }.join(\"&\")}\"\n }\n\nreturn 0\n\n/**************************************************************\n * Helper method to rearrange our values in the\n * form below for easier parsing later\n *\n * [bgpNeighbor1: [datapoint1:value, datapoint2:value, ..],\n * bgpNeighbor2: [datapoint1:value, dataoint2: value, ..],\n * ..\n * ]\n ***************************************************************/\ndef walkHandler(HashMap ifMap) {\n // Empty map to store our ouput\n Map outputArray = [:]\n ifMap.each {\n indexOid, value ->\n // Separate our indexes\n (counter_index, index) = indexOid.split(/\\./, 2)\n\n if (!outputArray[index]) {\n outputArray[index] = [:]\n }\n\n if (ilpMap[counter_index]) {\n outputArray[index] += [(ilpMap[counter_index]): value]\n }\n }\n return outputArray\n}\n"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get(\"system.hostname\")\ndef props = hostProps.toProperties()\ndef timeout = 25000\n\nneighborMap = Snmp.walkAsMap(host, \".1.3.6.1.4.1.41916.14.9.1\", props, timeout)\n\nlegendMap = [\n '27': 'messagesReceived',\n '28': 'messagesSent',\n '29': 'prefixReceived',\n '30': 'prefixValid',\n '31': 'prefixInstalled',\n '32': 'outQueue',\n '34': 'neighborState',\n '35': 'openInCount',\n '36': 'openOutCount',\n '37': 'notifyInCount',\n '38': 'notifyOutCount',\n '39': 'updateInCount',\n '40': 'updateOutCount',\n '41': 'keepAliveInCount',\n '42': 'keepAliveOutCount',\n '43': 'refreshInCount',\n '44': 'refreshOutCount',\n '45': 'dynamicInCount',\n '46': 'dynamicOutCount',\n '53': 'neighborLastResetTime'\n]\n\nneighborMap.each {\n oidIndex, value ->\n (metricIndex, wildvalue) = oidIndex.split(/\\./, 2)\n\n if (legendMap.containsKey(metricIndex)) {\n println \"${wildvalue}.${legendMap[metricIndex]}=${value}\"\n }\n}\n\nreturn 0"}, "datapoints": [{"name": "dynamicInCount", "description": "Dynamic capability message input count.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.dynamicInCount", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dynamicOutCount", "description": "Dynamic capability message output count.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.dynamicOutCount", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "keepAliveInCount", "description": "Keepalive message input count", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.keepAliveInCount", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "keepAliveOutCount", "description": "Keepalive message output count", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.keepAliveOutCount", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "messagesReceived", "description": "The number of messages received per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.messagesReceived", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "messagesSent", "description": "The number of messages sent per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.messagesSent", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "neighborLastResetTime", "description": "The amount of time in seconds since the neighbor was last restarted.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.neighborLastResetTime", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "neighborResetAlert", "description": "Alerts if status is up and the last restart time was within the latest polling interval. Alerts are sent through the neighborState datapoint so this only alerts when the peering state is established.", "interpretMethod": "expression", "interpretExpr": "if(eq(neighborState,5), if(lt(neighborLastResetTime, ##POLLINTERVAL##), 1, 0), 0)", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "= 1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "BGP peering ##INSTANCE## on Viptela host ##HOST## has restarted since the last poll and has only been up for ##neighborLastResetTime## seconds, placing it in ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "neighborState", "description": "Current state of the BGP neighbor. \n\nStatus codes:\n0=Idle,\n1=Connect,\n2=Active,\n3=Open Sent,\n4=Open Confirm,\n5=Established,\n6=Clearing,\n7=Deleted", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.neighborState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "7", "threshold": "!= 5", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "BGP peering on Viptela host ##HOST## for peering ##INSTANCE## is not in established state, reporting a status code of ##VALUE##, placing the instance in ##LEVEL## state.\n\nPlease ensure there is connectivity with the BGP peer. \n\nStatus codes:\n0=Idle,\n1=Connect,\n2=Active,\n3=Open Sent,\n4=Open Confirm,\n5=Established,\n6=Clearing,\n7=Deleted\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "notifyInCount", "description": "Notify input count.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.notifyInCount", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "notifyOutCount", "description": "Notify output count.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.notifyOutCount", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "openInCount", "description": "Open messages input count.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.openInCount", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "openOutCount", "description": "Open messages output count.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.openOutCount", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "outQueue", "description": "Output queue depth.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.outQueue", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "prefixInstalled", "description": "Number of installed routes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.prefixInstalled", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "prefixReceived", "description": "Number of routes received", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.prefixReceived", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "prefixValid", "description": "Number of valid routes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.prefixValid", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "refreshInCount", "description": "Route refresh message input count", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.refreshInCount", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "refreshOutCount", "description": "Route refresh message output count.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.refreshOutCount", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "updateInCount", "description": "Update message input count", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.updateInCount", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "updateOutCount", "description": "Update message output count", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.updateOutCount", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Input Message By Type", "title": "Input Message By Type", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "dynamicInCount", "datapointName": "dynamicInCount", "consolidationFn": "average"}, {"name": "keepAliveInCount", "datapointName": "keepAliveInCount", "consolidationFn": "average"}, {"name": "messagesReceived", "datapointName": "messagesReceived", "consolidationFn": "average"}, {"name": "notifyInCount", "datapointName": "notifyInCount", "consolidationFn": "average"}, {"name": "openInCount", "datapointName": "openInCount", "consolidationFn": "average"}, {"name": "refreshInCount", "datapointName": "refreshInCount", "consolidationFn": "average"}, {"name": "updateInCount", "datapointName": "updateInCount", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Dynamic", "color": "lime", "datapointName": "dynamicInCount", "isVirtual": false}, {"type": "stack", "legend": "Keep-Alive", "color": "red", "datapointName": "keepAliveInCount", "isVirtual": false}, {"type": "stack", "legend": "Total Received", "color": "aqua", "datapointName": "messagesReceived", "isVirtual": false}, {"type": "stack", "legend": "Notify", "color": "yellow", "datapointName": "notifyInCount", "isVirtual": false}, {"type": "stack", "legend": "Open", "color": "fuchsia", "datapointName": "openInCount", "isVirtual": false}, {"type": "stack", "legend": "Refresh", "color": "black", "datapointName": "refreshInCount", "isVirtual": false}, {"type": "stack", "legend": "Update", "color": "orange2", "datapointName": "updateInCount", "isVirtual": false}]}, {"name": "Messages", "title": "Messages", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "messagesReceived", "datapointName": "messagesReceived", "consolidationFn": "average"}, {"name": "messagesSent", "datapointName": "messagesSent", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "silver", "datapointName": "messagesReceived", "isVirtual": false}, {"type": "stack", "legend": "Sent", "color": "lime", "datapointName": "messagesSent", "isVirtual": false}]}, {"name": "Neighbor State", "title": "Neighbor State", "verticalLabel": "status code", "min": -1.0, "max": 10.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "neighborState", "datapointName": "neighborState", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "State", "color": "olive", "datapointName": "neighborState", "isVirtual": false}]}, {"name": "Output Message By Type", "title": "Output Message By Type", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "dynamicOutCount", "datapointName": "dynamicOutCount", "consolidationFn": "average"}, {"name": "keepAliveOutCount", "datapointName": "keepAliveOutCount", "consolidationFn": "average"}, {"name": "messagesSent", "datapointName": "messagesSent", "consolidationFn": "average"}, {"name": "notifyOutCount", "datapointName": "notifyOutCount", "consolidationFn": "average"}, {"name": "openOutCount", "datapointName": "openOutCount", "consolidationFn": "average"}, {"name": "refreshOutCount", "datapointName": "refreshOutCount", "consolidationFn": "average"}, {"name": "updateOutCount", "datapointName": "updateOutCount", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Dynamic", "color": "lime", "datapointName": "dynamicOutCount", "isVirtual": false}, {"type": "stack", "legend": "Keep-Alive", "color": "red", "datapointName": "keepAliveOutCount", "isVirtual": false}, {"type": "stack", "legend": "Total Sent", "color": "aqua", "datapointName": "messagesSent", "isVirtual": false}, {"type": "stack", "legend": "Notify", "color": "yellow", "datapointName": "notifyOutCount", "isVirtual": false}, {"type": "stack", "legend": "Open", "color": "fuchsia", "datapointName": "openOutCount", "isVirtual": false}, {"type": "stack", "legend": "Refresh", "color": "black", "datapointName": "refreshOutCount", "isVirtual": false}, {"type": "stack", "legend": "Update", "color": "orange2", "datapointName": "updateOutCount", "isVirtual": false}]}, {"name": "Output Queue", "title": "Output Queue", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "outQueue", "datapointName": "outQueue", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Output Queue", "color": "yellow", "datapointName": "outQueue", "isVirtual": false}]}, {"name": "Prefixes", "title": "Prefixes", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "prefixInstalled", "datapointName": "prefixInstalled", "consolidationFn": "average"}, {"name": "prefixReceived", "datapointName": "prefixReceived", "consolidationFn": "average"}, {"name": "prefixValid", "datapointName": "prefixValid", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Installed", "color": "silver", "datapointName": "prefixInstalled", "isVirtual": false}, {"type": "stack", "legend": "Received", "color": "yellow", "datapointName": "prefixReceived", "isVirtual": false}, {"type": "stack", "legend": "Valid", "color": "lime", "datapointName": "prefixValid", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 BGP Neighbors by Installed Prefixes", "title": "Top 10 BGP Neighbors by Installed Prefixes", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "prefixInstalled", "datapointName": "prefixInstalled", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "prefixInstalled", "isVirtual": false}]}, {"name": "Top 10 BGP Neighbors by Output Queue", "title": "Top 10 BGP Neighbors by Output Queue", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "outQueue", "datapointName": "outQueue", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "outQueue", "isVirtual": false}]}, {"name": "Top 10 BGP Neighbors by State", "title": "Top 10 BGP Neighbors by State", "verticalLabel": "status code", "min": -1.0, "max": 10.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "neighborState", "datapointName": "neighborState", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "neighborState", "isVirtual": false}]}, {"name": "Top 10 BGP Neighbors by Total Messages", "title": "Top 10 BGP Neighbors by Total Messages", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "messagesReceived", "datapointName": "messagesReceived", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "messagesSent", "datapointName": "messagesSent", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "totalMessages", "expr": "messagesReceived+messagesSent"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "totalMessages", "isVirtual": true}]}]}

×DataSource: Infoblox_Appliance_Disk (1516)

{"name": "Infoblox_Appliance_Disk", "description": "Gathers disk usage for Infoblox devices using SNMP.", "appliesTo": "hasCategory(\"Infoblox\")", "searchKeywords": "infoblox,disk,disks,snmp", "displayedAs": "Infoblox Disk", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\nhostName = hostProps.get(\"system.hostname\");\nprops = hostProps.toProperties()\ntimeout = 10000\n\n// MIB only supports 2 nodes\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3\", 1)\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.11.1.3\", 2)\n\nreturn 0\n\n// Helper method to parse our response\ndef parseServiceInfo(String oid, Integer nodeId)\n{\n\n def serviceInfo = Snmp.walkAsMap(hostName, oid, props, timeout)\n\n serviceInfo.each {\n serviceOid, value ->\n\n // We only care about the primary drive\n if (value.toLowerCase().contains('primary drive'))\n {\n println \"${nodeId}##Node ${nodeId}##Primary Drive\"\n }\n }\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\nhostName = hostProps.get(\"system.hostname\");\nprops = hostProps.toProperties()\ntimeout = 10000\n\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3\", 1)\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.11.1.3\", 2)\n\nreturn 0\n\ndef parseServiceInfo(String oid, Integer nodeId)\n{\n\n def serviceInfo = Snmp.walkAsMap(hostName, oid, props, timeout)\n\n serviceInfo.each {\n serviceOid, value ->\n if (value.toLowerCase().contains('primary drive'))\n {\n println \"${nodeId}.disk=${value.tokenize('%')[0]}\"\n }\n }\n}"}, "datapoints": [{"name": "DiskUsage", "description": "The percentage of the disk that is being utilized by the node.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.disk", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Disk Usage", "title": "Disk Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskUsage", "datapointName": "DiskUsage", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Disk Usage", "color": "silver", "datapointName": "DiskUsage", "isVirtual": false}]}], "overviewGraphs": [{"name": "Disk Usage", "title": "Disk Usage", "verticalLabel": "%", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskUsage", "datapointName": "DiskUsage", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "DiskUsage", "isVirtual": false}]}]}

×DataSource: Infoblox_Appliance_Fans (1515)

{"name": "Infoblox_Appliance_Fans", "description": "Gathers fan RPMs on Infoblox devices using SNMP.", "appliesTo": "hasCategory(\"Infoblox\")", "searchKeywords": "infoblox,fan,snmp,fans", "displayedAs": "Infoblox Fans", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\nprops = hostProps.toProperties()\nhostName = hostProps.get(\"system.hostname\")\ntimeout = 5000;\nactiveDiscovery = true\n\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3\", 1)\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.11.1.3\", 2)\n\nreturn 0\n\ndef parseServiceInfo(String oid, Integer nodeId)\n{\n\n def serviceEntry = Snmp.walkAsMap(hostName, oid, props, timeout)\n\n serviceEntry.each {\n oidIndex, status ->\n // Make sure fan exists\n if (activeDiscovery && (status.toLowerCase().contains('fan') && !status.toLowerCase().contains('not exist')))\n {\n def wildvalue = \"${nodeId}-${status.tokenize(':')[0].replace('FAN ', '')}\"\n // Clean up instance name\n println \"${wildvalue}##Node ${nodeId} - ${(status.tokenize(':'))[0].toLowerCase().capitalize()}######auto.infoblox.node=Node ${nodeId}\"\n }\n else\n {\n if ((status.toLowerCase().contains('fan') && !status.toLowerCase().contains('not exist')))\n {\n def wildvalue = \"${nodeId}-${status.tokenize(':')[0].replace('FAN ', '')}\"\n // We only want the numeric value\n def rpm = (status.replace(' RPM', '').replace(' ', '').tokenize(':')[1])\n println \"${wildvalue}.fan=${rpm}\"\n }\n }\n }\n}"}, "groupMethod": "ilp", "groupExpr": "auto.infoblox.node"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\nprops = hostProps.toProperties()\nhostName = hostProps.get(\"system.hostname\")\ntimeout = 5000;\nactiveDiscovery = false\n\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3\", 1)\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.11.1.3\", 2)\n\nreturn 0\n\ndef parseServiceInfo(String oid, Integer nodeId)\n{\n\n def serviceEntry = Snmp.walkAsMap(hostName, oid, props, timeout)\n\n serviceEntry.each {\n oidIndex, status ->\n // Make sure fan exists\n if (activeDiscovery && (status.toLowerCase().contains('fan') && !status.toLowerCase().contains('not exist')))\n {\n def wildvalue = \"${nodeId}-${status.tokenize(':')[0].replace('FAN ', '')}\"\n // Clean up instance name\n println \"${wildvalue}##Node ${nodeId} - ${(status.tokenize(':'))[0].toLowerCase().capitalize()}######auto.infoblox.node=Node ${nodeId}\"\n }\n else\n {\n if ((status.toLowerCase().contains('fan') && !status.toLowerCase().contains('not exist')))\n {\n def wildvalue = \"${nodeId}-${status.tokenize(':')[0].replace('FAN ', '')}\"\n // We only want the numeric value\n def rpm = (status.replace(' RPM', '').replace(' ', '').tokenize(':')[1])\n println \"${wildvalue}.fan=${rpm}\"\n }\n }\n }\n}"}, "datapoints": [{"name": "FanRPM", "description": "The fan's RPMs.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.fan", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Fan RPM", "title": "Fan RPM", "verticalLabel": "RPM", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "FanRPM", "datapointName": "FanRPM", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Fan RPM", "color": "silver", "datapointName": "FanRPM", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Fans by Highest RPM", "title": "Top 10 Fans by Highest RPM", "verticalLabel": "RPM", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "FanRPM", "datapointName": "FanRPM", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "FanRPM", "isVirtual": false}]}]}

×DataSource: Infoblox_Appliance_Memory (1514)

{"name": "Infoblox_Appliance_Memory", "description": "Gather system memory and swap space usage on Infoblox devices using SNMP.", "appliesTo": "hasCategory(\"Infoblox\")", "searchKeywords": "infoblox,memory,swap,snmp", "displayedAs": "Infoblox Memory", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\nprops = hostProps.toProperties()\nhostName = hostProps.get(\"system.hostname\")\ntimeout = 5000;\nactiveDiscovery = true\n\n// Has this node been discovered?\nnodesFound = []\n\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3\", 1)\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.11.1.3\", 2)\n\nreturn 0\n\ndef parseServiceInfo(String oid, Integer nodeId)\n{\n\n def serviceEntry = Snmp.walkAsMap(hostName, oid, props, timeout)\n\n serviceEntry.each {\n oidIndex, status ->\n // Only discover nodes that have info\n if (!nodesFound.contains(nodeId) && activeDiscovery && (status.toLowerCase().contains('swap space') || status.toLowerCase().contains('system memory')))\n {\n println \"${nodeId}##Node ${nodeId}\"\n // Mark this node as discovered\n nodesFound += nodeId\n }\n else\n {\n // Grab numeric value\n def mem = (status.tokenize('%')[0])\n\n // Check if we're looking for this metric\n if (status.toLowerCase().contains('system memory'))\n {\n println \"${nodeId}.sysmem=${mem.toDouble()}\"\n }\n if (status.toLowerCase().contains('swap space'))\n {\n println \"${nodeId}.swap=${mem.toDouble()}\"\n }\n\n }\n }\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\nprops = hostProps.toProperties()\nhostName = hostProps.get(\"system.hostname\")\ntimeout = 5000;\nactiveDiscovery = false\n\n// Has this node been discovered?\nnodesFound = []\n\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3\", 1)\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.11.1.3\", 2)\n\nreturn 0\n\ndef parseServiceInfo(String oid, Integer nodeId)\n{\n\n def serviceEntry = Snmp.walkAsMap(hostName, oid, props, timeout)\n\n serviceEntry.each {\n oidIndex, status ->\n // Only discover nodes that have info\n if (!nodesFound.contains(nodeId) && activeDiscovery && (status.toLowerCase().contains('swap space') || status.toLowerCase().contains('system memory')))\n {\n println \"${nodeId}##Node ${nodeId}\"\n // Mark this node as discovered\n nodesFound += nodeId\n }\n else\n {\n // Grab numeric value\n def mem = (status.tokenize('%')[0])\n\n // Check if we're looking for this metric\n if (status.toLowerCase().contains('system memory'))\n {\n println \"${nodeId}.sysmem=${mem.toDouble()}\"\n }\n if (status.toLowerCase().contains('swap space'))\n {\n println \"${nodeId}.swap=${mem.toDouble()}\"\n }\n\n }\n }\n}"}, "datapoints": [{"name": "SwapSpace", "description": "The percentage of allocated swap space in use.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.swap", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 90", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "The swap space on Infoblox host ##HOST## is current at ##VALUE## % putting the host in a ##LEVEL## status.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "SystemMemory", "description": "The percentage of system memory that is in use.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sysmem", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 90", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "The system memory on Infoblox host ##HOST## is current at ##VALUE## % putting the host in a ##LEVEL## status.\n\nThis started at ##START## - or ##DURATION## ago."}], "graphs": [{"name": "Swap Space", "title": "Swap Space", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SwapSpace", "datapointName": "SwapSpace", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Swap Space", "color": "silver", "datapointName": "SwapSpace", "isVirtual": false}]}, {"name": "System Memory", "title": "System Memory", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SystemMemory", "datapointName": "SystemMemory", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "System Memory", "color": "lime", "datapointName": "SystemMemory", "isVirtual": false}]}]}

×DataSource: Infoblox_Appliance_NetworkServices (1513)

{"name": "Infoblox_Appliance_NetworkServices", "description": "Monitors the status of available network services from Infoblox devices using SNMP.", "appliesTo": "hasCategory(\"Infoblox\")", "searchKeywords": "infoblox,service,dns,services,ntp,dhcp", "displayedAs": "Infoblox Network Services Status", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\ndef host = hostProps.get(\"system.hostname\");\ndef props = hostProps.toProperties()\ndef timeout = 5000;\n\ndef serviceEntry = Snmp.walkAsMap(host, \".1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2\", props, timeout);\n\ndef ad = true\n\n// https://docs.infoblox.com/display/MAG8/Infoblox+MIBs#InfobloxMIBs-bookmark654\n\nserviceMap = [\n\"1\" : \"DHCP Service\",\n\"2\" : \"DNS Service\",\n\"3\" : \"NTP Service\",\n\"4\" : \"TFTP File Distribution\",\n\"5\" : \"HTTP File Distribution\",\n\"6\" : \"FTP\",\n\"7\" : \"Moving boxTools Service\",\n\"8\" : \"bloxTools Service\",\n\"9\" : \"Node Status\",\n\"10\": \"Disk Usage\",\n\"11\": \"LAN 1 Port\",\n\"12\": \"LAN 2 Port\",\n\"13\": \"HA Port\",\n\"14\": \"MGMT Port\",\n\"15\": \"LCD\",\n\"16\": \"Memory\",\n\"17\": \"Replication\",\n\"18\": \"DB Object\",\n\"19\": \"RAID Summary\",\n\"20\": \"RAID Disk 1\",\n\"21\": \"RAID Disk 2\",\n\"22\": \"RAID Disk 3\",\n\"23\": \"RAID Disk 4\",\n\"24\": \"Fan1\",\n\"25\": \"Fan2\",\n\"26\": \"Fan3\",\n\"27\": \"Power Supply\",\n\"28\": \"NTP Sync\",\n\"29\": \"CPU1 Temperature\",\n\"30\": \"CPU2 Temperature\",\n\"31\": \"System Temperature\",\n\"32\": \"Raid Battery\",\n\"33\": \"CPU Usage\",\n\"34\": \"OSPC\",\n\"35\": \"BGP\",\n\"36\": \"MGM Service\",\n\"37\": \"Subgrid Connectivity\",\n\"38\": \"Network Capacity\"\n]\n\nserviceEntry.each {\n oid, status ->\n if (ad)\n {\n println \"${oid}##${serviceMap[oid]}\"\n }\n else\n {\n println \"${oid}.status=${status}\"\n }\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\ndef host = hostProps.get(\"system.hostname\");\ndef props = hostProps.toProperties()\ndef timeout = 5000;\n\ndef serviceEntry = Snmp.walkAsMap(host, \".1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2\", props, timeout);\n\ndef ad = false\n\n// https://docs.infoblox.com/display/MAG8/Infoblox+MIBs#InfobloxMIBs-bookmark654\n\nserviceMap = [\n\"1\" : \"DHCP Service\",\n\"2\" : \"DNS Service\",\n\"3\" : \"NTP Service\",\n\"4\" : \"TFTP File Distribution\",\n\"5\" : \"HTTP File Distribution\",\n\"6\" : \"FTP\",\n\"7\" : \"Moving boxTools Service\",\n\"8\" : \"bloxTools Service\",\n\"9\" : \"Node Status\",\n\"10\": \"Disk Usage\",\n\"11\": \"LAN 1 Port\",\n\"12\": \"LAN 2 Port\",\n\"13\": \"HA Port\",\n\"14\": \"MGMT Port\",\n\"15\": \"LCD\",\n\"16\": \"Memory\",\n\"17\": \"Replication\",\n\"18\": \"DB Object\",\n\"19\": \"RAID Summary\",\n\"20\": \"RAID Disk 1\",\n\"21\": \"RAID Disk 2\",\n\"22\": \"RAID Disk 3\",\n\"23\": \"RAID Disk 4\",\n\"24\": \"Fan1\",\n\"25\": \"Fan2\",\n\"26\": \"Fan3\",\n\"27\": \"Power Supply\",\n\"28\": \"NTP Sync\",\n\"29\": \"CPU1 Temperature\",\n\"30\": \"CPU2 Temperature\",\n\"31\": \"System Temperature\",\n\"32\": \"Raid Battery\",\n\"33\": \"CPU Usage\",\n\"34\": \"OSPC\",\n\"35\": \"BGP\",\n\"36\": \"MGM Service\",\n\"37\": \"Subgrid Connectivity\",\n\"38\": \"Network Capacity\"\n]\n\nserviceEntry.each {\n oid, status ->\n if (ad)\n {\n println \"${oid}##${serviceMap[oid]}\"\n }\n else\n {\n println \"${oid}.status=${status}\"\n }\n}\n\nreturn 0"}, "datapoints": [{"name": "ServiceStatus", "description": "Returns all health points available and their status value.\n\nStatus Codes:\n1=working\n2=warning\n3=failed\n4=inactive\n5=unknown", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "1", "max": "5", "threshold": "= 2 3", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The ##INSTANCE## service on host ##HOST## is reporting a status of ##VALUE## placing the host in a ##LEVEL## state.\n\nStatus Codes:\n1=working\n2=warning\n3=failed\n4=inactive\n5=unknown\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Service Status", "title": "Service Status", "verticalLabel": "status code", "min": 0.0, "max": 6.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ServiceStatus", "datapointName": "ServiceStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "silver", "datapointName": "ServiceStatus", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Network Services By Health", "title": "Top 10 Network Services By Health", "verticalLabel": "status code", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ServiceStatus", "datapointName": "ServiceStatus", "consolidationFn": "average", "aggregateMethod": "min"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "ServiceStatus", "isVirtual": false}]}]}

×DataSource: Infoblox_Appliance_Node (1512)

{"name": "Infoblox_Appliance_Node", "description": "Monitors the status of available network services from Infoblox devices using SNMP.", "appliesTo": "hasCategory(\"Infoblox\")", "searchKeywords": "infoblox,node,health,network,status", "displayedAs": "Infoblox Node Status", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\nprops = hostProps.toProperties()\nhostName = hostProps.get(\"system.hostname\")\ntimeout = 5000;\nactiveDiscovery = true\n\n// https://docs.infoblox.com/display/MAG8/Infoblox+MIBs#InfobloxMIBs-bookmark654\n\nserviceMap = [\n\"1\" : \"DHCP Service\",\n\"2\" : \"DNS Service\",\n\"3\" : \"NTP Service\",\n\"4\" : \"TFTP File Distribution\",\n\"5\" : \"HTTP File Distribution\",\n\"6\" : \"FTP\",\n\"7\" : \"Moving boxTools Service\",\n\"8\" : \"bloxTools Service\",\n\"9\" : \"Node Status\",\n\"10\": \"Disk Usage\",\n\"11\": \"LAN 1 Port\",\n\"12\": \"LAN 2 Port\",\n\"13\": \"HA Port\",\n\"14\": \"MGMT Port\",\n\"15\": \"LCD\",\n\"16\": \"Memory\",\n\"17\": \"Replication\",\n\"18\": \"DB Object\",\n\"19\": \"RAID Summary\",\n\"20\": \"RAID Disk 1\",\n\"21\": \"RAID Disk 2\",\n\"22\": \"RAID Disk 3\",\n\"23\": \"RAID Disk 4\",\n\"24\": \"Fan1\",\n\"25\": \"Fan2\",\n\"26\": \"Fan3\",\n\"27\": \"Power Supply\",\n\"28\": \"NTP Sync\",\n\"29\": \"CPU1 Temperature\",\n\"30\": \"CPU2 Temperature\",\n\"31\": \"System Temperature\",\n\"32\": \"Raid Battery\",\n\"33\": \"CPU Usage\",\n\"34\": \"OSPC\",\n\"35\": \"BGP\",\n\"36\": \"MGM Service\",\n\"37\": \"Subgrid Connectivity\",\n\"38\": \"Network Capacity\"\n]\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.10.1.2\", 1)\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.11.1.2\", 2)\n\nreturn 0\n\ndef parseServiceInfo(String oid, Integer nodeId)\n{\n\n def serviceEntry = Snmp.walkAsMap(hostName, oid, props, timeout)\n\n serviceEntry.each {\n oidIndex, status ->\n if (activeDiscovery && serviceMap[oidIndex])\n {\n println \"${nodeId}-${oidIndex}##${serviceMap[oidIndex]} / Node ${nodeId}######auto.infoblox.node=Node-${nodeId}\"\n }\n else\n {\n println \"${nodeId}-${oidIndex}.status=${status}\"\n }\n }\n}"}, "groupMethod": "ilp", "groupExpr": "auto.infoblox.node"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\nprops = hostProps.toProperties()\nhostName = hostProps.get(\"system.hostname\")\ntimeout = 5000;\nactiveDiscovery = false\n\n// https://docs.infoblox.com/display/MAG8/Infoblox+MIBs#InfobloxMIBs-bookmark654\n\nserviceMap = [\n\"1\" : \"DHCP Service\",\n\"2\" : \"DNS Service\",\n\"3\" : \"NTP Service\",\n\"4\" : \"TFTP File Distribution\",\n\"5\" : \"HTTP File Distribution\",\n\"6\" : \"FTP\",\n\"7\" : \"Moving boxTools Service\",\n\"8\" : \"bloxTools Service\",\n\"9\" : \"Node Status\",\n\"10\": \"Disk Usage\",\n\"11\": \"LAN 1 Port\",\n\"12\": \"LAN 2 Port\",\n\"13\": \"HA Port\",\n\"14\": \"MGMT Port\",\n\"15\": \"LCD\",\n\"16\": \"Memory\",\n\"17\": \"Replication\",\n\"18\": \"DB Object\",\n\"19\": \"RAID Summary\",\n\"20\": \"RAID Disk 1\",\n\"21\": \"RAID Disk 2\",\n\"22\": \"RAID Disk 3\",\n\"23\": \"RAID Disk 4\",\n\"24\": \"Fan1\",\n\"25\": \"Fan2\",\n\"26\": \"Fan3\",\n\"27\": \"Power Supply\",\n\"28\": \"NTP Sync\",\n\"29\": \"CPU1 Temperature\",\n\"30\": \"CPU2 Temperature\",\n\"31\": \"System Temperature\",\n\"32\": \"Raid Battery\",\n\"33\": \"CPU Usage\",\n\"34\": \"OSPC\",\n\"35\": \"BGP\",\n\"36\": \"MGM Service\",\n\"37\": \"Subgrid Connectivity\",\n\"38\": \"Network Capacity\"\n]\n\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.10.1.2\", 1)\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.11.1.2\", 2)\n\nreturn 0\n\ndef parseServiceInfo(String oid, Integer nodeId)\n{\n\n def serviceEntry = Snmp.walkAsMap(hostName, oid, props, timeout)\n\n serviceEntry.each {\n oidIndex, status ->\n if (activeDiscovery && serviceMap[oidIndex])\n {\n println \"${nodeId}-${oidIndex}##Node ${nodeId} / ${serviceMap[oidIndex]}######auto.infoblox.node=Node-${nodeId}\"\n }\n else\n {\n if (serviceMap[oidIndex])\n {\n println \"${nodeId}-${oidIndex}.status=${status}\"\n }\n }\n }\n}"}, "datapoints": [{"name": "ServiceStatus", "description": "Returns all health points available and their status value.\n\nStatus Codes:\n1=working\n2=warning\n3=failed\n4=inactive\n5=unknown", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "1", "max": "5", "threshold": "= 2 3", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The ##INSTANCE## service on host ##HOST## is reporting a status of ##VALUE## placing the host in a ##LEVEL## state.\n\nStatus Codes:\n1=working\n2=warning\n3=failed\n4=inactive\n5=unknown\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Service Status", "title": "Service Status", "verticalLabel": "status code", "min": 0.0, "max": 6.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ServiceStatus", "datapointName": "ServiceStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "silver", "datapointName": "ServiceStatus", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Services By Health", "title": "Top 10 Services By Health", "verticalLabel": "status code", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ServiceStatus", "datapointName": "ServiceStatus", "consolidationFn": "average", "aggregateMethod": "min"}], "virtualDatapoints": [{"name": "Status", "expr": "if(eq(ServiceStatus, 5), unkn(), ServiceStatus)"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Status", "isVirtual": true}]}]}

×DataSource: Infoblox_Appliance_Replication (1511)

{"name": "Infoblox_Appliance_Replication", "description": "Gather replication information from Infoblox devices using SNMP.", "appliesTo": "hasCategory(\"Infoblox\")", "searchKeywords": "infoblox,replication,snmp,status", "displayedAs": "Infoblox Replication Status", "collectionInterval": "1m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\nimport groovy.time.*;\n\nhostName = hostProps.get(\"system.hostname\");\nprops = hostProps.toProperties()\ntimeout = 10000\n\nad = true\n\nparseServiceInfo(\"1.3.6.1.4.1.7779.3.1.1.2.1.2.1\")\n\nreturn 0\n\ndef parseServiceInfo(String oid)\n{\n\n def serviceInfo = Snmp.walkAsMap(hostName, oid, props, timeout)\n def statusMap = [\"offline\": \"0\", \"online\": \"1\", \"snapshotting\": \"2\"]\n def metricMap = [\"2\": \"status\", \"3\": \"queueIn\", \"4\": \"lastTimeIn\", \"5\": \"queueOut\", \"6\": \"lastTimeOut\"]\n\n serviceInfo.each {\n serviceOid, value ->\n\n // Figure out what we're looking at\n def metric = serviceOid.tokenize(\".\")[0]\n\n // Grab the node IP\n if (ad && metric == \"1\")\n {\n println \"${serviceOid.replaceFirst('1.', '')}##${value}\"\n }\n else\n {\n // Convert status to number\n if (metric == \"2\")\n {\n println \"${serviceOid.replaceFirst(metric + '.', '')}.${metricMap[metric]}=${statusMap[value.toLowerCase()]}\"\n }\n // Print out queues\n if (metric == \"3\" || metric == \"5\")\n {\n println \"${serviceOid.replaceFirst(metric + '.', '')}.${metricMap[metric]}=${value}\"\n }\n // Convert to seconds since last replication\n if (metric == \"4\" || metric == \"6\")\n {\n def td = TimeCategory.minus(new Date(), new Date(value))\n println \"${serviceOid.replaceFirst(metric + '.', '')}.${metricMap[metric]}=${td.toMilliseconds() / 1000}\"\n }\n }\n }\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\nimport groovy.time.*;\n\nhostName = hostProps.get(\"system.hostname\");\nprops = hostProps.toProperties()\ntimeout = 10000\n\nad = false\n\nparseServiceInfo(\"1.3.6.1.4.1.7779.3.1.1.2.1.2.1\")\n\nreturn 0\n\ndef parseServiceInfo(String oid)\n{\n\n def serviceInfo = Snmp.walkAsMap(hostName, oid, props, timeout)\n def statusMap = [\"offline\": \"0\", \"online\": \"1\", \"snapshotting\": \"2\"]\n def metricMap = [\"2\": \"status\", \"3\": \"queueIn\", \"4\": \"lastTimeIn\", \"5\": \"queueOut\", \"6\": \"lastTimeOut\"]\n\n serviceInfo.each {\n serviceOid, value ->\n\n // Figure out what we're looking at\n def metric = serviceOid.tokenize(\".\")[0]\n\n // Grab the node IP\n if (ad && metric == \"1\")\n {\n println \"${serviceOid.replaceFirst('1.', '')}##${value}\"\n }\n else\n {\n // Convert status to number\n if (metric == \"2\")\n {\n println \"${serviceOid.replaceFirst(metric + '.', '')}.${metricMap[metric]}=${statusMap[value.toLowerCase()]}\"\n }\n // Print out queues\n if (metric == \"3\" || metric == \"5\")\n {\n println \"${serviceOid.replaceFirst(metric + '.', '')}.${metricMap[metric]}=${value}\"\n }\n // Convert to seconds since last replication\n if (metric == \"4\" || metric == \"6\")\n {\n def td = TimeCategory.minus(new Date(), new Date(value))\n println \"${serviceOid.replaceFirst(metric + '.', '')}.${metricMap[metric]}=${td.toMilliseconds() / 1000}\"\n }\n }\n }\n}"}, "datapoints": [{"name": "LastRepFromMaster", "description": "The number of seconds since the last receive time from the master.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.lastTimeOut", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "LastRepToMaster", "description": "The number of seconds since the last sent time from the master.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.lastTimeIn", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "QueueFromMaster", "description": "The number of jobs in the sent queue coming from master.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.queueIn", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "QueueToMaster", "description": "The number of jobs in the receive queue to master.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.queueOut", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Status", "description": "The replication status of the node.\n\nStatus Codes\n0=offline\n1=online\n2=snapshotting", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "threshold": "= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The Infoblox device ##HOST## is reporting a status of ##VALUE## on ##INSTANCE## placing the device in a ##LEVEL## state.\n\nStatus Codes\n0=offline\n1=online\n2=snapshotting\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Last Replication Time", "title": "Last Replication Time", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "LastRepFromMaster", "datapointName": "LastRepFromMaster", "consolidationFn": "average"}, {"name": "LastRepToMaster", "datapointName": "LastRepToMaster", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Out Master", "color": "lime", "datapointName": "LastRepFromMaster", "isVirtual": false}, {"type": "line", "legend": "In Master", "color": "silver", "datapointName": "LastRepToMaster", "isVirtual": false}]}, {"name": "Queue Length", "title": "Queue Length", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "QueueFromMaster", "datapointName": "QueueFromMaster", "consolidationFn": "average"}, {"name": "QueueToMaster", "datapointName": "QueueToMaster", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Out Master", "color": "silver", "datapointName": "QueueFromMaster", "isVirtual": false}, {"type": "line", "legend": "In Master", "color": "lime", "datapointName": "QueueToMaster", "isVirtual": false}]}, {"name": "Replication Status", "title": "Replication Status", "verticalLabel": "status code", "min": -1.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status Code", "color": "blue", "datapointName": "Status", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Nodes By Last Replication Time From Master", "title": "Top 10 Nodes By Last Replication Time From Master", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "LastRepFromMaster", "datapointName": "LastRepFromMaster", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "LastRepFromMaster", "isVirtual": false}]}, {"name": "Top 10 Nodes By Last Replication Time To Master", "title": "Top 10 Nodes By Last Replication Time To Master", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "LastRepToMaster", "datapointName": "LastRepToMaster", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "LastRepToMaster", "isVirtual": false}]}, {"name": "Top 10 Nodes By Queue Length", "title": "Top 10 Nodes By Queue Length", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "QueueFromMaster", "datapointName": "QueueFromMaster", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "QueueToMaster", "datapointName": "QueueToMaster", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "TotalQueue", "expr": "QueueFromMaster+QueueToMaster"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "TotalQueue", "isVirtual": true}]}]}

×DataSource: Infoblox_Appliance_Temperature (1510)

{"name": "Infoblox_Appliance_Temperature", "description": "Monitors system and CPU temperature on Inflobox devices using SNMP.", "appliesTo": "hasCategory(\"Infoblox\")", "searchKeywords": "infoblox,temperature,snmp", "displayedAs": "Infoblox Temperature", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\nprops = hostProps.toProperties()\nhostName = hostProps.get(\"system.hostname\")\ntimeout = 5000;\nactiveDiscovery = true\n\nnodesFound = []\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3\", 1)\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.11.1.3\", 2)\n\nreturn 0\n\ndef parseServiceInfo(String oid, Integer nodeId)\n{\n\n def serviceEntry = Snmp.walkAsMap(hostName, oid, props, timeout)\n\n serviceEntry.each {\n oidIndex, status ->\n // Only discover nodes with data\n if (!nodesFound.contains(nodeId) && activeDiscovery && (status.toLowerCase().contains('cpu_temp') || status.toLowerCase().contains('sys_temp')))\n {\n println \"${nodeId}##Node ${nodeId}\"\n nodesFound += nodeId\n }\n else\n {\n\n // Grab numeric value\n def temp = (status.replace(' C', '').replace('+', '').tokenize(': ')[1])\n\n // Grab CPU Temp if we got it\n if (status.toLowerCase().contains('cpu_temp'))\n {\n println \"${nodeId}.cputemp=${temp.toDouble()}\"\n }\n // Grab System Temp if we got it\n if (status.toLowerCase().contains('sys_temp'))\n {\n println \"${nodeId}.systemp=${temp.toDouble()}\"\n }\n }\n }\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp;\n\nprops = hostProps.toProperties()\nhostName = hostProps.get(\"system.hostname\")\ntimeout = 5000;\nactiveDiscovery = false\n\nnodesFound = []\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3\", 1)\nparseServiceInfo(\".1.3.6.1.4.1.7779.3.1.1.2.1.11.1.3\", 2)\n\nreturn 0\n\ndef parseServiceInfo(String oid, Integer nodeId)\n{\n\n def serviceEntry = Snmp.walkAsMap(hostName, oid, props, timeout)\n\n serviceEntry.each {\n oidIndex, status ->\n // Only discover nodes with data\n if(!nodesFound.contains(nodeId)&&activeDiscovery&&(status.toLowerCase().contains('cpu_temp') || status.toLowerCase().contains('sys_temp')))\n {\n println \"${nodeId}##Node ${nodeId}\"\n nodesFound += nodeId\n }else{\n\n // Grab numeric value\n def temp = (status.replace(' C', '').replace('+', '').tokenize(': ')[1])\n\n // Grab CPU Temp if we got it\n if(status.toLowerCase().contains('cpu_temp')){\n println \"${nodeId}.cputemp=${temp.toDouble()}\"\n }\n // Grab System Temp if we got it\n if(status.toLowerCase().contains('sys_temp')){\n println \"${nodeId}.systemp=${temp.toDouble()}\"\n }\n }\n }\n}"}, "datapoints": [{"name": "CpuTemp", "description": "The CPU temperature measured in degrees Celsius.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cputemp", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SystemTemp", "description": "The system temperature measured in degrees Celsius.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.systemp", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "> 35", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "The temperature on Infoblox device ##HOST## is reporting a value ##VALUE## degrees Celsius putting it in a ##LEVEL## state.\n\nInfoblox devices have an operating temperature that ranges from 10\u00b0C to 35\u00b0C.\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "CPU Temperature", "title": "CPU Temperature", "verticalLabel": "\u00b0C", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CpuTemp", "datapointName": "CpuTemp", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Cpu Temperature", "color": "silver", "datapointName": "CpuTemp", "isVirtual": false}]}, {"name": "System Temperature", "title": "System Temperature", "verticalLabel": "\u00b0C", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SystemTemp", "datapointName": "SystemTemp", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "System Temperature", "color": "silver", "datapointName": "SystemTemp", "isVirtual": false}]}]}

×DataSource: F5_BigIP_Cache (1493)

{"name": "F5_BigIP_Cache", "description": "RAM Cache is a cache of HTTP objects stored in the BIG-IP systems random access memory (RAM) for reuse by subsequent connections to reduce the amount of traffic load on back-end servers.", "appliesTo": "hasCategory(\"F5Active\")", "searchKeywords": "bigip,cache,loadbalancer,memory,f5,ram", "technicalNotes": "hasCategory(\"F5Active\")", "displayedAs": "Cache", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0 // Exit code to indicate successful or error program exit\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n def cache_values = query_oid(\"1.3.6.1.4.1.3375.2.1.1.2.4\", query_details) // Call function to query the base system oid\n if (cache_values instanceof Map && cache_values != null && !(cache_values?.isEmpty())) { // Confirm that we received valid data from query\n print_results(cache_values) // Call function to print applicable oids\n } else { // If invalid data is received, print error and set status to 1\n println(\"FATAL ERROR: Failed to query F5 RAM Cache Metrics.\\nReturned SNMP value from ${query_details?.host} was invalid ($cache_values)\")\n exit_code = 1\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout)?.findAll{it?.key?.tokenize(\".\")?.first()?.toInteger() in 46..54} // Query base oid and return only values in applicable range\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n\ndef print_results(Map results) {\n int hits = 0,\n misses = 0,\n hit_ratio = 0\n // Map that assigns datapoint names for each oid\n Map cache_oids = [\"46.0\" : \"cache_hits\",\n \"47.0\" : \"cache_misses\",\n \"48.0\" : \"cache_misses_all\",\n \"49.0\" : \"cache_hit_bytes\",\n \"50.0\" : \"cache_miss_bytes\",\n \"51.0\" : \"cache_miss_bytes_all\",\n \"52.0\" : \"cache_size\",\n \"53.0\" : \"cache_count\",\n \"54.0\" : \"cache_evictions\"]\n results.each { index, value -> // Loop through each oid value in map\n try {\n if (cache_oids?.containsKey(index)) println(\"${cache_oids?.get(index)}=$value\") // If the oid is in cache_oids map, print it to terminal for collection\n } catch (Exception err) { // Print error message if script fails to print results (continue to next value in map)\n println(\"SCRIPT ERROR: Failed to determine metrics for \\'$index\\'. Returned value was $value.\\n${err?.message}\")\n }\n }\n try { // Attempt to calculate hit ratio percentage\n if (results?.containsKey(\"46.0\") && results?.containsKey(\"47.0\")) { // Print hitratio (Hits/(Hits+Misses)*100). Eliminate divide by zero issues.\n hits = results?.get(\"46.0\")?.toLong()\n misses = results?.get(\"47.0\")?.toLong()\n if (hits > 0 || misses > 0) hit_ratio = hits / (hits + misses) * 100\n }\n println(\"hit_ratio=$hit_ratio\")\n } catch (Exception err) {\n println(\"SCRIPT ERROR: Unable to determine Hit Ratio Percentage.\\n${err?.message}\")\n }\n}"}, "datapoints": [{"name": "Count", "description": "The number of items stored in RAM cache.", "interpretMethod": "namevalue", "interpretExpr": "cache_count", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Evictions", "description": "The number of RAM cache evictions.", "interpretMethod": "namevalue", "interpretExpr": "cache_evictions", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HitBytes", "description": "The number of RAM cache hits in bytes.", "interpretMethod": "namevalue", "interpretExpr": "cache_hit_bytes", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HitRatio", "description": "Determines the percentage of cache hits.", "interpretMethod": "namevalue", "interpretExpr": "hit_ratio", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertSubject": "F5 ##HOST## High Cache Hit Frequency", "alertBody": "F5 ##HOST## is reporting that only ##VALUE## percent of the requests that could be cached are having cache hits. You may wish to increase the size of the RAM cache.\n\nStart Time: ##START##\nDuration: ##DURATION##\nDevice State: ##LEVEL##"}, {"name": "Hits", "description": "The number of RAM cache hits.", "interpretMethod": "namevalue", "interpretExpr": "cache_hits", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MissBytes", "description": "The number of RAM cache misses in bytes, excluding un-cacheable data.", "interpretMethod": "namevalue", "interpretExpr": "cache_miss_bytes", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MissBytesAll", "description": "The total number of RAM cache misses in bytes.", "interpretMethod": "namevalue", "interpretExpr": "cache_miss_bytes_all", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Misses", "description": "The number of RAM cache misses, excluding un-cacheable data.", "interpretMethod": "namevalue", "interpretExpr": "cache_misses", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MissesAll", "description": "The total number of RAM cache misses.", "interpretMethod": "namevalue", "interpretExpr": "cache_misses_all", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Size", "description": "The RAM cache current size.", "interpretMethod": "namevalue", "interpretExpr": "cache_size", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Evictions", "title": "Cache Evictions", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Evictions", "datapointName": "Evictions", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Evictions", "color": "red", "datapointName": "Evictions", "isVirtual": false}]}, {"name": "Hit Ratio", "title": "Cache Hit Ratio", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "HitRatio", "datapointName": "HitRatio", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Hits", "color": "silver", "datapointName": "HitRatio", "isVirtual": false}]}, {"name": "Items Stored", "title": "Cache Items Stored", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Count", "datapointName": "Count", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Items", "color": "fuchsia", "datapointName": "Count", "isVirtual": false}]}, {"name": "Size", "title": "Cache Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "Size", "datapointName": "Size", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Size", "color": "gray", "datapointName": "Size", "isVirtual": false}]}, {"name": "Status", "title": "Cache Status", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Hits", "datapointName": "Hits", "consolidationFn": "average"}, {"name": "Misses", "datapointName": "Misses", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Hits", "color": "olive", "datapointName": "Hits", "isVirtual": false}, {"type": "stack", "legend": "Misses", "color": "red2", "datapointName": "Misses", "isVirtual": false}]}, {"name": "Throughput", "title": "Cache Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "HitBytes", "datapointName": "HitBytes", "consolidationFn": "average"}, {"name": "MissBytes", "datapointName": "MissBytes", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Hits", "color": "olive", "datapointName": "HitBytes", "isVirtual": false}, {"type": "stack", "legend": "Misses", "color": "red2", "datapointName": "MissBytes", "isVirtual": false}]}, {"name": "Total Misses", "title": "Cache Total Misses", "verticalLabel": "count", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "MissesAll", "datapointName": "MissesAll", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Misses", "color": "yellow", "datapointName": "MissesAll", "isVirtual": false}]}, {"name": "Total Misses Size", "title": "Cache Total Misses Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "MissBytesAll", "datapointName": "MissBytesAll", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Misses", "color": "orange", "datapointName": "MissBytesAll", "isVirtual": false}]}]}

×DataSource: F5_BigIP_Compression (1492)

{"name": "F5_BigIP_Compression", "description": "Determines if compression is enabled for F5 BIGIP Devices. Displays the number of pre and post compressed bytes for varying MIME-Types.", "appliesTo": "hasCategory(\"F5Active\")", "searchKeywords": "bigip,loadbalancer,postcompress,compression,precompress,f5", "displayedAs": "Compression", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0 // Exit code to indicate successful or error exiting the program\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Timeout duration (10 seconds)\ntry {\n def oid_values = query_oid(\"1.3.6.1.4.1.3375.2.1.1.2.22\", query_details) // Call function to query the base system oid\n if (oid_values instanceof Map && oid_values != null && !(oid_values?.isEmpty())) { // Confirm that we received valid data from query\n print_results(oid_values) // Call function to print applicable oids\n } else { // If invalid data is received, print error and set status to 1\n println(\"FATAL ERROR: Failed to query F5 Compression Metrics.\\nReturned SNMP value from ${query_details?.host} was invalid ($oid_values)\")\n exit_code = 1\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout)?.findAll{it?.key?.tokenize(\".\")?.first()?.toInteger() in 2..26} // Query base oid and return only values in applicable range\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n\ndef print_results(Map results) {\n int hits = 0,\n misses = 0,\n hit_ratio = 0\n // Map that assigns datapoint names for each oid\n Map oid_names = [\"2.0\" : \"precompress_bytes\",\n \"3.0\" : \"postcompress_bytes\",\n \"4.0\" : \"null_compress_bytes\",\n \"5.0\" : \"html_precompress_bytes\",\n \"6.0\" : \"html_postcompress_bytes\",\n \"7.0\" : \"css_precompress_bytes\",\n \"8.0\" : \"css_postcompress_bytes\",\n \"9.0\" : \"js_precompress_bytes\",\n \"10.0\" : \"js_postcompress_bytes\",\n \"11.0\" : \"xml_precompress_bytes\",\n \"12.0\" : \"xml_postcompress_bytes\",\n \"13.0\" : \"sgml_precompress_bytes\",\n \"14.0\" : \"sgml_postcompress_bytes\",\n \"15.0\" : \"plain_precompress_bytes\",\n \"16.0\" : \"plain_postcompress_bytes\",\n \"17.0\" : \"octet_precompress_bytes\",\n \"18.0\" : \"octet_postcompress_bytes\",\n \"19.0\" : \"image_precompress_bytes\",\n \"20.0\" : \"image_postcompress_bytes\",\n \"21.0\" : \"video_precompress_bytes\",\n \"22.0\" : \"video_postcompress_bytes\",\n \"23.0\" : \"audio_precompress_bytes\",\n \"24.0\" : \"audio_postcompress_bytes\",\n \"25.0\" : \"other_precompress_bytes\",\n \"26.0\" : \"other_postcompress_bytes\"]\n results.each { index, value -> // Loop through each oid value in map\n try {\n if (oid_names?.containsKey(index)) println(\"${oid_names?.get(index)}=$value\") // If the oid is in oid_names map, print it to terminal for collection\n } catch (Exception err) { // Print error message if script fails to print results (continue to next value in map)\n println(\"SCRIPT ERROR: Failed to determine metrics for $index. Returned value was $value.\\n${err?.message}\")\n }\n }\n}"}, "datapoints": [{"name": "AudioPostcompress", "description": "The number of post-compressed bytes for the MIME-Types: Audio files.", "interpretMethod": "namevalue", "interpretExpr": "audio_postcompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "AudioPrecompress", "description": "The number of pre-compressed bytes for the MIME-Types: Audio files.", "interpretMethod": "namevalue", "interpretExpr": "audio_precompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CSSPostcompress", "description": "The number of post-compressed bytes for the MIME-Types: CSS.", "interpretMethod": "namevalue", "interpretExpr": "css_postcompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CSSPrecompress", "description": "The number of pre-compressed bytes for the MIME-Types: CSS.", "interpretMethod": "namevalue", "interpretExpr": "css_precompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HTMLPostcompress", "description": "The number of post-compressed bytes for the MIME-Types: HTML.", "interpretMethod": "namevalue", "interpretExpr": "html_postcompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HTMLPrecompress", "description": "The number of pre-compressed bytes for the MIME-Types: HTML.", "interpretMethod": "namevalue", "interpretExpr": "html_precompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ImagePostcompress", "description": "The number of post-compressed bytes for the MIME-Types: Images.", "interpretMethod": "namevalue", "interpretExpr": "image_postcompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ImagePrecompress", "description": "The number of pre-compressed bytes for the MIME-Types: Images.", "interpretMethod": "namevalue", "interpretExpr": "image_precompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "JSPostcompress", "description": "The number of post-compressed bytes for the MIME-Types: Javascript.", "interpretMethod": "namevalue", "interpretExpr": "js_postcompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "JSPrecompress", "description": "The number of pre-compressed bytes for the MIME-Types: Javascript.", "interpretMethod": "namevalue", "interpretExpr": "js_precompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NullCompress", "description": "The number of bytes subjected to NULL compression (for license enforcement).", "interpretMethod": "namevalue", "interpretExpr": "null_compress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OctectPostprocess", "description": "The number of post-compressed bytes for the MIME-Types: Octet stream.", "interpretMethod": "namevalue", "interpretExpr": "octet_postcompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OctetPrecompress", "description": "The number of pre-compressed bytes for the MIME-Types: Octet stream.", "interpretMethod": "namevalue", "interpretExpr": "octet_precompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OtherPostcompress", "description": "The number of post-compressed bytes for the MIME-Types: other than HTML, CSS, Javascript, XML, SGML, Plain, Images, Video files, Audio files.", "interpretMethod": "namevalue", "interpretExpr": "other_postcompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OtherPrecompress", "description": "The number of pre-compressed bytes for the MIME-Types: other than HTML, CSS, Javascript, XML, SGML, Plain, Images, Video files, Audio files.", "interpretMethod": "namevalue", "interpretExpr": "other_precompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PlainPostcompress", "description": "The number of post-compressed bytes for the MIME-Types: Plain.", "interpretMethod": "namevalue", "interpretExpr": "plain_postcompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PlainPrecompress", "description": "The number of pre-compressed bytes for the MIME-Types: Plain.", "interpretMethod": "namevalue", "interpretExpr": "plain_precompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SGMLPostcompress", "description": "The number of post-compressed bytes for the MIME-Types: SGML.", "interpretMethod": "namevalue", "interpretExpr": "sgml_postcompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SGMLPrecompress", "description": "The number of pre-compressed bytes for the MIME-Types: SGML.", "interpretMethod": "namevalue", "interpretExpr": "sgml_precompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalPostCompress", "description": "The number of response bytes after compression has taken place.", "interpretMethod": "namevalue", "interpretExpr": "postcompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalPrecompress", "description": "The number of response bytes before compression has taken place.", "interpretMethod": "namevalue", "interpretExpr": "precompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "VideoPostcompress", "description": "The number of post-compressed bytes for the MIME-Types: Video files.", "interpretMethod": "namevalue", "interpretExpr": "video_postcompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "VideoPrecompress", "description": "The number of pre-compressed bytes for the MIME-Types: Video files.", "interpretMethod": "namevalue", "interpretExpr": "video_precompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "XMLPostcompress", "description": "The number of post-compressed bytes for the MIME-Types: XML.", "interpretMethod": "namevalue", "interpretExpr": "xml_postcompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "XMLPrecompress", "description": "The number of pre-compressed bytes for the MIME-Types: XML.", "interpretMethod": "namevalue", "interpretExpr": "xml_precompress_bytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Audio", "title": "Audio Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "AudioPostcompress", "datapointName": "AudioPostcompress", "consolidationFn": "average"}, {"name": "AudioPrecompress", "datapointName": "AudioPrecompress", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Post-Compression", "color": "yellow", "datapointName": "AudioPostcompress", "isVirtual": false}, {"type": "stack", "legend": "Pre-Compression", "color": "fuchsia", "datapointName": "AudioPrecompress", "isVirtual": false}]}, {"name": "CSS", "title": "CSS Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "CSSPostcompress", "datapointName": "CSSPostcompress", "consolidationFn": "average"}, {"name": "CSSPrecompress", "datapointName": "CSSPrecompress", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Post-Compression", "color": "black", "datapointName": "CSSPostcompress", "isVirtual": false}, {"type": "stack", "legend": "Pre-Compression", "color": "gray", "datapointName": "CSSPrecompress", "isVirtual": false}]}, {"name": "HTML", "title": "HTML Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "HTMLPostcompress", "datapointName": "HTMLPostcompress", "consolidationFn": "average"}, {"name": "HTMLPrecompress", "datapointName": "HTMLPrecompress", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Post-Compression", "color": "red", "datapointName": "HTMLPostcompress", "isVirtual": false}, {"type": "area", "legend": "Pre-Compression", "color": "orange2", "datapointName": "HTMLPrecompress", "isVirtual": false}]}, {"name": "Image", "title": "Image Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "ImagePostcompress", "datapointName": "ImagePostcompress", "consolidationFn": "average"}, {"name": "ImagePrecompress", "datapointName": "ImagePrecompress", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Post-Compression", "color": "olive", "datapointName": "ImagePostcompress", "isVirtual": false}, {"type": "stack", "legend": "Pre-Compression", "color": "orange2", "datapointName": "ImagePrecompress", "isVirtual": false}]}, {"name": "JS", "title": "JS Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "JSPostcompress", "datapointName": "JSPostcompress", "consolidationFn": "average"}, {"name": "JSPrecompress", "datapointName": "JSPrecompress", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Post-Compression", "color": "green", "datapointName": "JSPostcompress", "isVirtual": false}, {"type": "stack", "legend": "Pre-Compression", "color": "lime", "datapointName": "JSPrecompress", "isVirtual": false}]}, {"name": "Null", "title": "Null Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 12, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "NullCompress", "datapointName": "NullCompress", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Null Compression", "color": "fuchsia", "datapointName": "NullCompress", "isVirtual": false}]}, {"name": "Octet", "title": "Octet Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "OctectPostprocess", "datapointName": "OctectPostprocess", "consolidationFn": "average"}, {"name": "OctetPrecompress", "datapointName": "OctetPrecompress", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Post-Compression", "color": "navy", "datapointName": "OctectPostprocess", "isVirtual": false}, {"type": "stack", "legend": "Pre-Compression", "color": "lime", "datapointName": "OctetPrecompress", "isVirtual": false}]}, {"name": "Other", "title": "Other Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 13, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "OtherPostcompress", "datapointName": "OtherPostcompress", "consolidationFn": "average"}, {"name": "OtherPrecompress", "datapointName": "OtherPrecompress", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Post-Compression", "color": "orange", "datapointName": "OtherPostcompress", "isVirtual": false}, {"type": "stack", "legend": "Pre-Compression", "color": "blue", "datapointName": "OtherPrecompress", "isVirtual": false}]}, {"name": "Plain", "title": "Plain Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "PlainPostcompress", "datapointName": "PlainPostcompress", "consolidationFn": "average"}, {"name": "PlainPrecompress", "datapointName": "PlainPrecompress", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Post-Compression", "color": "orange2", "datapointName": "PlainPostcompress", "isVirtual": false}, {"type": "stack", "legend": "Pre-Compression", "color": "yellow", "datapointName": "PlainPrecompress", "isVirtual": false}]}, {"name": "SGML", "title": "SGML Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "SGMLPostcompress", "datapointName": "SGMLPostcompress", "consolidationFn": "average"}, {"name": "SGMLPrecompress", "datapointName": "SGMLPrecompress", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Post-Compression", "color": "red2", "datapointName": "SGMLPostcompress", "isVirtual": false}, {"type": "stack", "legend": "Pre-Compression", "color": "yellow", "datapointName": "SGMLPrecompress", "isVirtual": false}]}, {"name": "Total", "title": "Total Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "TotalPostCompress", "datapointName": "TotalPostCompress", "consolidationFn": "average"}, {"name": "TotalPrecompress", "datapointName": "TotalPrecompress", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Post-Compression", "color": "navy", "datapointName": "TotalPostCompress", "isVirtual": false}, {"type": "stack", "legend": "Pre-Compression", "color": "teal", "datapointName": "TotalPrecompress", "isVirtual": false}]}, {"name": "Video", "title": "Video Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "VideoPostcompress", "datapointName": "VideoPostcompress", "consolidationFn": "average"}, {"name": "VideoPrecompress", "datapointName": "VideoPrecompress", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Post-Compression", "color": "teal", "datapointName": "VideoPostcompress", "isVirtual": false}, {"type": "stack", "legend": "Pre-Compression", "color": "fuchsia", "datapointName": "VideoPrecompress", "isVirtual": false}]}, {"name": "XML", "title": "XML Compression", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "XMLPostcompress", "datapointName": "XMLPostcompress", "consolidationFn": "average"}, {"name": "XMLPrecompress", "datapointName": "XMLPrecompress", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Post-Compression", "color": "maroon", "datapointName": "XMLPostcompress", "isVirtual": false}, {"type": "stack", "legend": "Pre-Compression", "color": "fuchsia", "datapointName": "XMLPrecompress", "isVirtual": false}]}]}

×DataSource: F5_BigIP_FailoverStatus (1137)

{"name": "F5_BigIP_FailoverStatus", "description": "Determines the failover status for F5 BIG-IP Devices.", "appliesTo": "hasCategory(\"F5\")", "searchKeywords": "bigip,loadbalancer,failover,f5,network,status", "displayedAs": "Failover Status", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0 // Exit code to indicate successful or error program exit\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\nMap required_oids = [\"1.3.6.1.4.1.3375.2.1.14.3\" : [\"1.0\" : \"failover_status\",\n \"3.0\" : \"failover_color\"]]\ntry {\n required_oids?.each { index, sub_oids ->\n def returned_values = query_oid(index, query_details, sub_oids) // Call function to query the base system oid\n if (returned_values instanceof Map && returned_values != null && !(returned_values?.isEmpty())) { // Confirm that we received valid data from query\n print_results(returned_values, sub_oids) // Call function to print applicable oids\n } else { // If invalid data is received, print error and set status to 1\n println(\"FATAL ERROR: Failed to query F5 Failover Status at OID $index.\\nReturned SNMP value from ${query_details?.host} was invalid ($returned_values)\")\n exit_code = 1\n }\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details, Map filters) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout)?.findAll{filters?.containsKey(it?.key)}\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n\ndef print_results(Map results, Map sub_oids) {\n sub_oids?.each { index, name ->\n if (results?.containsKey(index)) println(\"$name=${results?.get(index)}\") // Convert kB to bytes by multiplying by 1000\n }\n}"}, "datapoints": [{"name": "FailoverColor", "description": "The color of the failover status on the system.\n\n- 0 Green: The system is functioning correctly\n- 1 Yellow: The system may be functioning suboptimally\n- 2 Red: The system requires attention to function correctly\n- 3 Blue: The system's status is unknown or incomplete\n- 4 Gray: The system is intentionally not functioning (offline)\n- 5 Black: The system is not connected to any peers", "interpretMethod": "namevalue", "interpretExpr": "failover_color", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "5", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "FailoverColorAlert", "description": "Returns 0 is the color is green (OK) or grey (standby). Otherwise returns the FailoverColor value and alerts.", "interpretMethod": "expression", "interpretExpr": "if(eq(in(1,2,3,5,FailoverColor), 1), FailoverColor, 0)", "type": "gauge", "dataType": 7, "min": "0", "max": "5", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## System Health Degraded", "alertBody": "F5 BIGIP ##HOST## has a system health status of ##VALUE## (See corresponding values below). Entering this system health status has placed the host into a ##LEVEL## state.\n\nSystem Health Status Codes:\n- 0 Green: The system is functioning correctly\n- 1 Yellow: The system may be functioning suboptimally\n- 2 Red: The system requires attention to function correctly\n- 3 Blue: The system's status is unknown or incomplete\n- 4 Gray: The system is intentionally not functioning (offline)\n- 5 Black: The system is not connected to any peers\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "FailoverStatus", "description": "The failover status ID on the system.\n\n- 0 Unknown: The failover status of the device is unknown\n- 1 Offline: The device is offline\n- 2 Forced Offline: The device is forced offline\n- 3 Standby: The device is standby\n- 4 Active: The device is active", "interpretMethod": "namevalue", "interpretExpr": "failover_status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "4", "threshold": "<= 2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## Failover Status is Unknown or Offline", "alertBody": "F5 BIGIP ##HOST## has a failover status of ##VALUE## (See corresponding values below). Entering this failover status has placed the host into a ##LEVEL## state.\n\nFailover Status Codes:\n- 0 Unknown: The failover status of the device is unknown\n- 1 Offline: The device is offline\n- 2 Forced Offline: The device is forced offline\n- 3 Standby: The device is standby\n- 4 Active: The device is active\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Failover Status", "title": "Failover Status", "verticalLabel": "status code", "min": -1.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "FailoverStatus", "datapointName": "FailoverStatus", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Failover", "color": "olive", "datapointName": "FailoverStatus", "isVirtual": false}]}, {"name": "System Health", "title": "System Health", "verticalLabel": "status code", "min": -1.0, "max": 6.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "FailoverColor", "datapointName": "FailoverColor", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Health", "color": "orange2", "datapointName": "FailoverColor", "isVirtual": false}]}]}

×DataSource: F5_BigIP_Fans (1478)

{"name": "F5_BigIP_Fans", "description": "Monitors status and speed of F5 BIGIP Indexed Chassis Fans.", "appliesTo": "hasCategory(\"F5\")", "searchKeywords": "bigip,loadbalancer,chassis,f5,network,fans", "technicalNotes": "Fan Status Values are as follows:\n0: Bad\n1: Good\n2: Not Present\n\nA value of '0' means fan speed is unavailable while the associated chassis status is good.", "displayedAs": "Fans", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\nint exit_code = 0\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n def oid_values = query_oid(\"1.3.6.1.4.1.3375.2.1.3.2.1.2.1.1\", query_details) // Call function to query the base system oid\n if (oid_values instanceof Map && oid_values != null && !(oid_values?.isEmpty())) { // Confirm that we received valid data from query\n oid_values?.each{println(\"Fan_${it?.value}##Fan_${it?.value}##Chassis Fan Index ${it?.value}####\")} // Print active discovery instances\n } else { // If invalid data is received, print error and set status to 1\n println(\"FATAL ERROR: Failed to query F5 Chassis Fan Indexes.\\nReturned SNMP value from ${query_details?.host} was invalid ($oid_values)\")\n exit_code = 1\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout) // Query base oid and return\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0 // Exit code to indicate successful or error program exit\nboolean index_found = true\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n Map results = [\"index\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.3.2.1.2.1.1\"],\n \"status\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.3.2.1.2.1.2\"],\n \"speed\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.3.2.1.2.1.3\"]]\n results?.each { name, details_map ->\n def query_results = query_oid(details_map?.oid, query_details) // Call function to query the base system oid\n if (query_results instanceof Map && query_results != null && !(query_results?.isEmpty())) { // Confirm that we received valid data from query\n details_map?.put(\"values\", query_results)\n } else { // If invalid data is received, print error and set status to 1\n println(\"ERROR: Failed to query metrics for Fan ${name?.capitalize()}.\\nReturned SNMP value from ${query_details?.host} was invalid ($query_results)\")\n if (name ==~ \"index\") index_found = false\n exit_code = 1\n }\n }\n if (index_found) {\n print_results(results)\n } else {\n println(\"FATAL ERROR: Unable to determine F5 Chassis Fan Indexes. Unable to proceed with data collection.\")\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout) // Query base oid and return only values in applicable range\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n\ndef print_results(Map results) {\n Map fans = results?.index // Make fan indexes its own Map\n results.remove(\"index\") // Remove index information from original Map\n fans?.values?.each { index, wildvalue ->\n results?.each { wildalias, data ->\n if (data?.values?.containsKey(index)) println(\"Fan_${wildvalue}.${wildalias}=${data?.values?.get(index)}\")\n }\n }\n}"}, "datapoints": [{"name": "FanSpeed", "description": "The actual speed of the indexed chassis fan on the system. This is only supported for the platform where the actual fan speed data is available. '0' means fan speed is unavailable while the associated chassis status is good", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.speed", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "FanStatus", "description": "The status of the indexed chassis fan on the system. This is only supported for the platform where the sensor data is available.\n\nStatus Values:\n0: Bad\n1: Good\n2: Not Present", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "threshold": "= 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## ##INSTANCE## has failed", "alertBody": "F5 BIGIP ##HOST## has a deprecated fan with a status of ##VALUE## (See corresponding values below). ##INSTANCE## has failed and requires replacement. This faulty fan has placed the host into a ##LEVEL## state.\n\n0: Bad\n1: Good\n2: Not Present\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Speed", "title": "Fan Speed", "verticalLabel": "RPM", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "FanSpeed", "datapointName": "FanSpeed", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Speed", "color": "red2", "datapointName": "FanSpeed", "isVirtual": false}]}, {"name": "Status", "title": "Fan Status", "verticalLabel": "status code", "min": -1.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "FanStatus", "datapointName": "FanStatus", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Status", "color": "orange2", "datapointName": "FanStatus", "isVirtual": false}]}], "overviewGraphs": [{"name": "Speeds", "title": "Top 10 Fan Speeds", "verticalLabel": "RPM", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "FanSpeed", "datapointName": "FanSpeed", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "area", "legend": "##INSTANCE##", "color": "silver", "datapointName": "FanSpeed", "isVirtual": false}]}, {"name": "Statuses", "title": "Top 10 Fan Statuses", "verticalLabel": "status code", "min": -1.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "FanStatus", "datapointName": "FanStatus", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "area", "legend": "##INSTANCE##", "color": "silver", "datapointName": "FanStatus", "isVirtual": false}]}]}

×DataSource: F5_BigIP_Filesystem (1491)

{"name": "F5_BigIP_Filesystem", "description": "Monitors logical file systems on F5 load balancers.", "appliesTo": "hasCategory(\"F5\")", "searchKeywords": "bigip,disk,loadbalancer,filesystem,f5,network", "displayedAs": "Filesystem", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\nint exit_code = 0\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n def oid_values = query_oid(\"1.3.6.1.4.1.3375.2.1.7.3.2.1.1\", query_details) // Call function to query the base system oid\n if (oid_values instanceof Map && oid_values != null && !(oid_values?.isEmpty())) { // Confirm that we received valid data from query\n oid_values?.each{println(\"${it?.value}##${it?.value}##\")} // Print active discovery instances\n } else { // If invalid data is received, print error and set status to 1\n println(\"FATAL ERROR: Failed to query Filesystem names. Returned SNMP value from ${query_details?.host} was invalid ($cache_values)\")\n exit_code = 1\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout) // Query base oid and return\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0 // Exit code to indicate successful or error program exit\nboolean filesystem_found = true\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n Map results = [\"filesystem\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.7.3.2.1.1\"],\n \"block_size\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.7.3.2.1.2\"],\n \"total_blocks\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.7.3.2.1.3\"],\n \"free_blocks\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.7.3.2.1.4\"],\n \"total_nodes\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.7.3.2.1.5\"],\n \"free_nodes\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.7.3.2.1.6\"]]\n results?.each { name, details_map ->\n def query_results = query_oid(details_map?.oid, query_details) // Call function to query the base system oid\n if (query_results instanceof Map && query_results != null && !(query_results?.isEmpty())) { // Confirm that we received valid data from query\n details_map?.put(\"values\", query_results)\n } else { // If invalid data is received, print error and set status to 1\n println(\"ERROR: Failed to query Filesystem metrics for \\'$name\\'.\\nReturned SNMP value from ${query_details?.host} was invalid ($query_results)\")\n if(name ==~ \"filesystem\") filesystem_found = false\n exit_code = 1\n }\n }\n if (filesystem_found) {\n print_results(results)\n } else {\n println(\"FATAL ERROR: Unable to determine Filesystem names. Unable to proceed with data collection.\")\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout) // Query base oid and return only values in applicable range\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n\ndef print_results(Map results) {\n Map filesystem = results?.filesystem // Make filesystem its own Map\n results.remove(\"filesystem\") // Remove filesystem information from original Map\n filesystem?.values?.each { index, wildvalue ->\n results?.each { wildalias, data ->\n if (data?.values?.containsKey(index)) println(\"${wildvalue}.${wildalias}=${data?.values?.get(index)}\")\n }\n }\n}"}, "datapoints": [{"name": "BlockSize", "description": "The number of bytes in the specified partition.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.block_size", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BlockUtilization", "description": "Determines the percentage of free space available.", "interpretMethod": "expression", "interpretExpr": "(FreeBlocks / TotalBlocks) * 100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "FreeBlocks", "description": "The number of free blocks in the specified partition.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.free_blocks", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "FreeNodes", "description": "The number of free file nodes in the specified partition.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.free_nodes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NodeUtilization", "description": "Determines the percentage of free nodes available.", "interpretMethod": "expression", "interpretExpr": "(FreeNodes / TotalNodes) * 100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalBlocks", "description": "The number of total blocks in the specified partition.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.total_blocks", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalNodes", "description": "The number of total file nodes in the specified partition.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.total_nodes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Block Utilization", "title": "Block Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BlockUtilization", "datapointName": "BlockUtilization", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilization", "color": "olive", "datapointName": "BlockUtilization", "isVirtual": false}]}, {"name": "Blocks", "title": "Total/Free Blocks", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "FreeBlocks", "datapointName": "FreeBlocks", "consolidationFn": "average"}, {"name": "TotalBlocks", "datapointName": "TotalBlocks", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Free", "color": "red", "datapointName": "FreeBlocks", "isVirtual": false}, {"type": "area", "legend": "Total", "color": "orange2", "datapointName": "TotalBlocks", "isVirtual": false}]}, {"name": "Node Utilization", "title": "Node Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "NodeUtilization", "datapointName": "NodeUtilization", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilization", "color": "yellow", "datapointName": "NodeUtilization", "isVirtual": false}]}, {"name": "Nodes", "title": "Total/Free Nodes", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "FreeNodes", "datapointName": "FreeNodes", "consolidationFn": "average"}, {"name": "TotalNodes", "datapointName": "TotalNodes", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Free", "color": "purple", "datapointName": "FreeNodes", "isVirtual": false}, {"type": "area", "legend": "Total", "color": "fuchsia", "datapointName": "TotalNodes", "isVirtual": false}]}, {"name": "Size", "title": "Block Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BlockSize", "datapointName": "BlockSize", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Block Size", "color": "blue", "datapointName": "BlockSize", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Filesystem Sizes", "title": "Top 10 Filesystem Sizes", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "BlockSize", "datapointName": "BlockSize", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "BlockSize", "isVirtual": false}]}, {"name": "Top 10 Filesystem Utilization", "title": "Top 10 Filesystem Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "BlockUtilization", "datapointName": "BlockUtilization", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "BlockUtilization", "isVirtual": false}]}, {"name": "Top 10 Node Utilization", "title": "Top 10 Node Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "NodeUtilization", "datapointName": "NodeUtilization", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "NodeUtilization", "isVirtual": false}]}]}

×DataSource: F5_BigIP_HA (692)

{"name": "F5_BigIP_HA", "description": "Monitors F5 BigIP High Availability related statuses.", "appliesTo": "hasCategory(\"F5\")", "searchKeywords": "high availability,bigip,loadbalancer,ha,redundancy,f5", "displayedAs": "High Availability", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0 // Exit code to indicate successful or error program exit\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\nMap required_oids = [\"1.3.6.1.4.1.3375.2.1.14\" : [\"1.1.0\" : \"sync_status\",\n \"3.1.0\" : \"failover_status\"],\n \"1.3.6.1.4.1.3375.2.1.1.1.1\" : [\"13.0\" : \"redundant_mode\",\n \"29.0\" : \"watchdog_state\"]]\ntry {\n required_oids?.each { index, sub_oids ->\n def returned_values = query_oid(index, query_details, sub_oids) // Call function to query the base system oid\n if (returned_values instanceof Map && returned_values != null && !(returned_values?.isEmpty())) { // Confirm that we received valid data from query\n print_results(returned_values, sub_oids) // Call function to print applicable oids\n } else { // If invalid data is received, print error and set status to 1\n println(\"FATAL ERROR: Failed to query F5 High Availability Metrics at OID $index.\\nReturned SNMP value from ${query_details?.host} was invalid ($returned_values)\")\n exit_code = 1\n }\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details, Map filters) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout)?.findAll{filters?.containsKey(it?.key)}\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n\ndef print_results(Map results, Map sub_oids) {\n sub_oids?.each { index, name ->\n if (results?.containsKey(index)) {\n println(\"$name=${results?.get(index)}\")\n } else {\n println(\"ERROR: Unable to determine value for $name.\")\n }\n }\n}"}, "datapoints": [{"name": "FailoverStatus", "description": "Failover status code:\n\n0 = Unknown \tThe failover status of the device is unknown.\n1 = Offline \tThe device is offline.\n2 = Forced Offline \tThe device is forced offline.\n3 = Standby \tThe device is standby.\n4 = Active \tThe device is active.", "interpretMethod": "namevalue", "interpretExpr": "failover_status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "4", "threshold": "<= 2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## Failover Status Degraded", "alertBody": "F5 BIGIP ##HOST## has a failover status of ##VALUE## (See corresponding values below). Entering this failover status has placed the host into a ##LEVEL## state.\n\n0 = Unknown \tThe failover status of the device is unknown.\n1 = Offline \tThe device is offline.\n2 = Forced Offline \tThe device is forced offline.\n3 = Standby \tThe device is standby.\n4 = Active \tThe device is active.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "RedundantMode", "description": "The redundant mode of the system.\n\nRedundancy Status Codes:\n- 0: False\n- 1: True", "interpretMethod": "namevalue", "interpretExpr": "redundant_mode", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "= 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## Redundancy disabled", "alertBody": "F5 BIGIP ##HOST## has lost redundancy and is no longer highly available (Redundancy Status: ##VALUE##). The system is currently operating in a ##LEVEL## state.\n\nRedundancy Status Codes:\n- 0: False\n- 1: True\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "SyncStatus", "description": "The sync status ID on the system.\n- 0 Unknown: The device is disconnected from the device group.\n- 1 Syncing: The device is joining the device group or has requested changes from device group or inconsistent with the group.\n- 2 Need Manual Sync: Changes have been made on the device not syncd to the device group.\n- 3 In Sync: The device is consistent with the device group.\n- 4 Sync Failed: The device is inconsistent with the device group, requires user intervention.\n- 5 Sync Disconnected: The device is not connected to any peers.\n- 6 Standalone: The device is in a standalone configuration.\n- 7 Awaiting Initial Sync: The device is waiting for initial sync.\n- 8 Incompatible Version: The device's version is incompatible with rest of the devices in the device group.\n-9 Partial Sync: Some but not all devices successfully received the last sync.", "interpretMethod": "namevalue", "interpretExpr": "sync_status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "9", "threshold": "!= 3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## Sync Status Degraded", "alertBody": "F5 BIGIP ##HOST## is no longer in synchronization with a sync status of ##VALUE## (See corresponding values below). Entering this sync status has placed the host into a ##LEVEL## state.\n\n- 0 Unknown: The device is disconnected from the device group.\n- 1 Syncing: The device is joining the device group or has requested changes from device group or inconsistent with the group.\n- 2 Need Manual Sync: Changes have been made on the device not syncd to the device group.\n- 3 In Sync: The device is consistent with the device group.\n- 4 Sync Failed: The device is inconsistent with the device group, requires user intervention.\n- 5 Sync Disconnected: The device is not connected to any peers.\n- 6 Standalone: The device is in a standalone configuration.\n- 7 Awaiting Initial Sync: The device is waiting for initial sync.\n- 8 Incompatible Version: The device's version is incompatible with rest of the devices in the device group.\n-9 Partial Sync: Some but not all devices successfully received the last sync.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "WatchdogState", "description": "The state of watchdog feature - a hardware device that monitors the system for hardware failure.\n\nStatus Code Values:\n- 0: Disabled\n- 1: Enabled", "interpretMethod": "namevalue", "interpretExpr": "watchdog_state", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "= 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## System Hardware Watchdog disabled", "alertBody": "F5 BIGIP ##HOST## system hardware watchdog is not enabled or has stopped functioning (Watchdog Status: ##VALUE##). The host is currently operating a ##LEVEL## state.\n\nStatus Code Values:\n- 0: Disabled\n- 1: Enabled\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Failover Status", "title": "HA Failover Status", "verticalLabel": "status code", "min": -1.0, "max": 6.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "FailoverStatus", "datapointName": "FailoverStatus", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Failover", "color": "silver", "datapointName": "FailoverStatus", "isVirtual": false}]}, {"name": "Redundancy", "title": "HA Redundancy Mode", "verticalLabel": "status code", "min": -1.0, "max": 2.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "RedundantMode", "datapointName": "RedundantMode", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Redundancy", "color": "olive", "datapointName": "RedundantMode", "isVirtual": false}]}, {"name": "Synchronization", "title": "HA Synchronization Status", "verticalLabel": "status code", "min": -1.0, "max": 10.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SyncStatus", "datapointName": "SyncStatus", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Synchronization", "color": "silver", "datapointName": "SyncStatus", "isVirtual": false}]}, {"name": "Watchdog", "title": "HA Watchdog Status", "verticalLabel": "status code", "min": -1.0, "max": 2.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "WatchdogState", "datapointName": "WatchdogState", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Watchdog", "color": "orange2", "datapointName": "WatchdogState", "isVirtual": false}]}]}

×DataSource: F5_BigIP_Interfaces (1490)

{"name": "F5_BigIP_Interfaces", "description": "Monitors the status of F5 BigIP Network Interfaces. Show inbound/outbound packet traffic and errors for each interface.", "appliesTo": "hasCategory(\"F5\")", "searchKeywords": "bigip,interfaces,loadbalancer,if,f5,network", "displayedAs": "Interfaces", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n def oid_values = query_oid(\"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.1\", query_details) // Call function to query the base system oid\n if (oid_values instanceof Map && oid_values != null && !(oid_values?.isEmpty())) { // Confirm that we received valid data from query\n oid_values?.each{println(\"Interface_${it?.value}##Interface_${it?.value}##\")} // Print active discovery instances\n } else { // If invalid data is received, print error and set status to 1\n println(\"FATAL ERROR: Failed to query F5 Network Interface Names. Returned SNMP value from ${query_details?.host} was invalid ($oid_values)\")\n exit_code = 1\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout) // Query base oid and return\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0 // Exit code to indicate successful or error program exit\nboolean index_found = true\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n Map results = [\"names\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.1\"],\n \"pkts_in\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.2\"],\n \"bytes_in\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.3\"],\n \"pkts_out\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.4\"],\n \"bytes_out\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.5\"],\n \"mcast_in\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.6\"],\n \"mcast_out\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.7\"],\n \"errors_in\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.8\"],\n \"errors_out\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.9\"],\n \"drops_in\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.10\"],\n \"drops_out\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.11\"],\n \"collisions\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.2.4.4.3.1.12\"]]\n results?.each { name, details_map ->\n def query_results = query_oid(details_map?.oid, query_details) // Call function to query the base system oid\n if (query_results instanceof Map && query_results != null && !(query_results?.isEmpty())) { // Confirm that we received valid data from query\n details_map?.put(\"values\", query_results)\n } else { // If invalid data is received, print error and set status to 1\n println(\"ERROR: Failed to query metrics for Network Interfaces at OID ${details_map?.oid}.\\nReturned SNMP value from ${query_details?.host} was invalid ($query_results)\")\n if (name ==~ \"index\") index_found = false\n exit_code = 1\n }\n }\n if (index_found) {\n print_results(results)\n } else {\n println(\"FATAL ERROR: Unable to determine Network Interface Names. Unable to proceed with data collection.\")\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout) // Query base oid and return only values in applicable range\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n\ndef print_results(Map results) {\n Map interfaces = results?.names // Make fan indexes its own Map\n results.remove(\"names\") // Remove index information from original Map\n interfaces?.values?.each { index, wildvalue ->\n results?.each { wildalias, data ->\n if (data?.values?.containsKey(index)) println(\"Interface_${wildvalue}.${wildalias}=${data?.values?.get(index)}\")\n }\n }\n}"}, "datapoints": [{"name": "BytesIn", "description": "The number of bytes received on the specified interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.bytes_in", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesOut", "description": "The number of bytes transmitted out of the specified interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.bytes_out", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Collisions", "description": "The number of collisions on the specified interface, incremented by the number of collisions experienced during transmissions of a frame.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.collisions", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DropsIn", "description": "The number of packets dropped on ingress for various reasons on the specified interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.drops_in", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DropsOut", "description": "The number of packets aged out or with excessive transmission delays due to multiple deferrals on the specified interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.drops_out", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ErrorsIn", "description": "The number of received packets that are either undersized, oversized, or have FCS errors by the specified interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.errors_in", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "threshold": ">= 10 50", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## ##INSTANCE## Receiving Inbound Traffic Errors", "alertBody": "F5 BIGIP ##HOST## ##INSTANCE## is receiving inbound traffic errors (Currently ##VALUE## Errors/Second Total). The host is currently operating at a ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "ErrorsOut", "description": "The number of excessive collisions, incremented for each frame that experienced 16 collisions during transmission and was aborted on the specified interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.errors_out", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "threshold": ">= 10 50", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## ##INSTANCE## Transmitting Outbound Traffic Errors", "alertBody": "F5 BIGIP ##HOST## ##INSTANCE## is transmitting outbound traffic errors (Currently ##VALUE## Errors/Second Total). The host is currently operating at a ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "MulticastIn", "description": "The number of multicast packets received on the specified interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.mcast_in", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MulticastOut", "description": "The number of multicast packets transmitted out of the specified interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.mcast_out", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsIn", "description": "The number of packets received on this interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pkts_in", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsOut", "description": "The number of packets transmitted out of the specified interface.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pkts_out", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Collisions", "title": "Networking Packet Collisions", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Collisions", "datapointName": "Collisions", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Collisions", "color": "yellow", "datapointName": "Collisions", "isVirtual": false}]}, {"name": "Drops", "title": "Networking Packet Drops", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DropsIn", "datapointName": "DropsIn", "consolidationFn": "average"}, {"name": "DropsOut", "datapointName": "DropsOut", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "orange2", "datapointName": "DropsIn", "isVirtual": false}, {"type": "stack", "legend": "Transmitted", "color": "red", "datapointName": "DropsOut", "isVirtual": false}]}, {"name": "Errors", "title": "Networking Packet Errors", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ErrorsIn", "datapointName": "ErrorsIn", "consolidationFn": "average"}, {"name": "ErrorsOut", "datapointName": "ErrorsOut", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "orange2", "datapointName": "ErrorsIn", "isVirtual": false}, {"type": "stack", "legend": "Transmitted", "color": "red2", "datapointName": "ErrorsOut", "isVirtual": false}]}, {"name": "Multicast Packets", "title": "Networking Multicast Packets", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "MulticastIn", "datapointName": "MulticastIn", "consolidationFn": "average"}, {"name": "MulticastOut", "datapointName": "MulticastOut", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "navy", "datapointName": "MulticastIn", "isVirtual": false}, {"type": "stack", "legend": "Transmitted", "color": "olive", "datapointName": "MulticastOut", "isVirtual": false}]}, {"name": "Traffic (Bytes)", "title": "Networking Traffic (Bytes)", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "BytesIn", "datapointName": "BytesIn", "consolidationFn": "average"}, {"name": "BytesOut", "datapointName": "BytesOut", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "navy", "datapointName": "BytesIn", "isVirtual": false}, {"type": "stack", "legend": "Transmitted", "color": "olive", "datapointName": "BytesOut", "isVirtual": false}]}, {"name": "Traffic (Packets)", "title": "Networking Traffic (Packets)", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PacketsIn", "datapointName": "PacketsIn", "consolidationFn": "average"}, {"name": "PacketsOut", "datapointName": "PacketsOut", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "navy", "datapointName": "PacketsIn", "isVirtual": false}, {"type": "stack", "legend": "Transmitted", "color": "olive", "datapointName": "PacketsOut", "isVirtual": false}]}], "overviewGraphs": [{"name": "Collisions", "title": "Top 10 Networking Packet Collisions", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Collisions", "datapointName": "Collisions", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Collisions", "isVirtual": false}]}, {"name": "Drops", "title": "Top 10 Networking Packet Drops", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "DropsIn", "datapointName": "DropsIn", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "DropsOut", "datapointName": "DropsOut", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Received", "color": "silver", "datapointName": "DropsIn", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Transmitted", "color": "silver", "datapointName": "DropsOut", "isVirtual": false}]}, {"name": "Errors", "title": "Top 10 Networking Packet Errors", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ErrorsIn", "datapointName": "ErrorsIn", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "ErrorsOut", "datapointName": "ErrorsOut", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Received", "color": "silver", "datapointName": "ErrorsIn", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Transmitted", "color": "silver", "datapointName": "ErrorsOut", "isVirtual": false}]}, {"name": "Multicast Packets", "title": "Top 10 Networking Multicast Packets", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "MulticastIn", "datapointName": "MulticastIn", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "MulticastOut", "datapointName": "MulticastOut", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Received", "color": "silver", "datapointName": "MulticastIn", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Transmitted", "color": "silver", "datapointName": "MulticastOut", "isVirtual": false}]}, {"name": "Traffic (Bytes)", "title": "Top 10 Networking Traffic (Bytes)", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "BytesIn", "datapointName": "BytesIn", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "BytesOut", "datapointName": "BytesOut", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Received", "color": "silver", "datapointName": "BytesIn", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Transmitted", "color": "silver", "datapointName": "BytesOut", "isVirtual": false}]}, {"name": "Traffic (Packets)", "title": "Top 10 Networking Traffic (Packets)", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "PacketsIn", "datapointName": "PacketsIn", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "PacketsOut", "datapointName": "PacketsOut", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Received", "color": "silver", "datapointName": "PacketsIn", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Transmitted", "color": "silver", "datapointName": "PacketsOut", "isVirtual": false}]}]}

×DataSource: F5_BigIP_Memory (1489)

{"name": "F5_BigIP_Memory", "description": "Monitors F5 BigIP Memory related statuses including Real, Virtual, and Swap Memory.", "appliesTo": "hasCategory(\"F5\")", "searchKeywords": "bigip,loadbalancer,memory,swap,f5,ram", "displayedAs": "Memory", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0 // Exit code to indicate successful or error program exit\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\nMap required_oids = [\"1.3.6.1.4.1.2021.4\" : [\"3.0\" : \"total_swap\",\n \"4.0\" : \"available_swap\",\n \"5.0\" : \"total_real_mem\",\n \"6.0\" : \"available_real_mem\",\n \"11.0\" : \"total_mem_free\",\n \"12.0\" : \"mem_minimum_swap\",\n \"13.0\" : \"mem_shared\",\n \"14.0\" : \"mem_buffer\",\n \"15.0\" : \"mem_cached\"]]\ntry {\n required_oids?.each { index, sub_oids ->\n def returned_values = query_oid(index, query_details, sub_oids) // Call function to query the base system oid\n if (returned_values instanceof Map && returned_values != null && !(returned_values?.isEmpty())) { // Confirm that we received valid data from query\n print_results(returned_values, sub_oids) // Call function to print applicable oids\n } else { // If invalid data is received, print error and set status to 1\n println(\"FATAL ERROR: Failed to query F5 Memory Metrics at OID $index.\\nReturned SNMP value from ${query_details?.host} was invalid ($returned_values)\")\n exit_code = 1\n }\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details, Map filters) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout)?.findAll{filters?.containsKey(it?.key)}\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n\ndef print_results(Map results, Map sub_oids) {\n sub_oids?.each { index, name ->\n if (results?.containsKey(index)) println(\"$name=${results?.get(index)?.toLong() * 1000}\") // Convert kB to bytes by multiplying by 1000\n }\n}"}, "datapoints": [{"name": "MemBuffer", "description": "The total amount of real or virtual memory currently allocated for use as memory buffers.\n\nThis object will not be implemented on hosts where the underlying operating system does not explicitly identify memory as specifically reserved for this purpose.", "interpretMethod": "namevalue", "interpretExpr": "mem_buffer", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemCached", "description": "The total amount of real or virtual memory currently allocated for use as cached memory.\n\nThis object will not be implemented on hosts where the underlying operating system does not explicitly identify memory as specifically reserved for this purpose.", "interpretMethod": "namevalue", "interpretExpr": "mem_cached", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemShared", "description": "The total amount of real or virtual memory currently allocated for use as shared memory.\n\nThis object will not be implemented on hosts where the underlying operating system does not explicitly identify memory as specifically reserved for this purpose.", "interpretMethod": "namevalue", "interpretExpr": "mem_shared", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MinimumSwap", "description": "The minimum amount of swap space expected to be kept free or available during normal operation of this host.", "interpretMethod": "namevalue", "interpretExpr": "mem_minimum_swap", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RealMemAvailable", "description": "The amount of real/physical memory currently unused or available.", "interpretMethod": "namevalue", "interpretExpr": "available_real_mem", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RealMemTotal", "description": "The total amount of real/physical memory installed on this host.", "interpretMethod": "namevalue", "interpretExpr": "total_real_mem", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SwapAvailable", "description": "The amount of swap space currently unused or available.", "interpretMethod": "namevalue", "interpretExpr": "available_swap", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SwapTotal", "description": "The total amount of swap space configured for this host.", "interpretMethod": "namevalue", "interpretExpr": "total_swap", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalMemFree", "description": "The total amount of memory free or available for use on this host. This value typically covers both real memory and swap space or virtual memory.", "interpretMethod": "namevalue", "interpretExpr": "total_mem_free", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Buffer", "title": "Buffer Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "MemBuffer", "datapointName": "MemBuffer", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Buffer Memory", "color": "silver", "datapointName": "MemBuffer", "isVirtual": false}]}, {"name": "Cache", "title": "Cached Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "MemCached", "datapointName": "MemCached", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Cached Memory", "color": "fuchsia", "datapointName": "MemCached", "isVirtual": false}]}, {"name": "Minimum Swap", "title": "Minimum Swap", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "MinimumSwap", "datapointName": "MinimumSwap", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Minimum Swap", "color": "red", "datapointName": "MinimumSwap", "isVirtual": false}]}, {"name": "Physical Memory", "title": "Available Physical Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "RealMemAvailable", "datapointName": "RealMemAvailable", "consolidationFn": "average"}, {"name": "RealMemTotal", "datapointName": "RealMemTotal", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Available", "color": "orange2", "datapointName": "RealMemAvailable", "isVirtual": false}, {"type": "area", "legend": "Total", "color": "yellow", "datapointName": "RealMemTotal", "isVirtual": false}]}, {"name": "Shared", "title": "Shared Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "MemShared", "datapointName": "MemShared", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Shared Memory", "color": "gray", "datapointName": "MemShared", "isVirtual": false}]}, {"name": "Swap", "title": "Available Swap", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "SwapAvailable", "datapointName": "SwapAvailable", "consolidationFn": "average"}, {"name": "SwapTotal", "datapointName": "SwapTotal", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Available", "color": "navy", "datapointName": "SwapAvailable", "isVirtual": false}, {"type": "area", "legend": "Total", "color": "teal", "datapointName": "SwapTotal", "isVirtual": false}]}, {"name": "Total Memory", "title": "Total Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "TotalMemFree", "datapointName": "TotalMemFree", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Total Memory", "color": "olive", "datapointName": "TotalMemFree", "isVirtual": false}]}]}

×DataSource: F5_BigIP_Power (1488)

{"name": "F5_BigIP_Power", "description": "Monitors status of F5 BigIP indexed chassis power supplies.", "appliesTo": "hasCategory(\"F5\")", "searchKeywords": "bigip,loadbalancer,psu,chassis,power,f5", "technicalNotes": "Power Supply Status Values are as follows:\n\n- 0: Bad\n- 1: Good\n- 2: Not Present", "displayedAs": "Power", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n def oid_values = query_oid(\"1.3.6.1.4.1.3375.2.1.3.2.2.2.1.1\", query_details) // Call function to query the base system oid\n if (oid_values instanceof Map && oid_values != null && !(oid_values?.isEmpty())) { // Confirm that we received valid data from query\n oid_values?.each{println(\"PowerSupply_${it?.value}##PowerSupply_${it?.value}##Power Supply Index ${it?.value}####\")} // Print active discovery instances\n } else { // If invalid data is received, print error and set status to 1\n println(\"FATAL ERROR: Failed to query F5 Chassis Power Supply Indexes. Returned SNMP value from ${query_details?.host} was invalid ($oid_values)\")\n exit_code = 1\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout) // Query base oid and return\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0 // Exit code to indicate successful or error program exit\nboolean index_found = true\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n Map results = [\"index\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.3.2.2.2.1.1\"],\n \"status\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.3.2.2.2.1.2\"]]\n results?.each { name, details_map ->\n def query_results = query_oid(details_map?.oid, query_details) // Call function to query the base system oid\n if (query_results instanceof Map && query_results != null && !(query_results?.isEmpty())) { // Confirm that we received valid data from query\n details_map?.put(\"values\", query_results)\n } else { // If invalid data is received, print error and set status to 1\n println(\"ERROR: Failed to query metrics for Power Supply OID ${details_map?.oid}.\\nReturned SNMP value from ${query_details?.host} was invalid ($query_results)\")\n if (name ==~ \"index\") index_found = false\n exit_code = 1\n }\n }\n if (index_found) {\n print_results(results)\n } else {\n println(\"FATAL ERROR: Unable to determine Power Supply Indexes. Unable to proceed with data collection.\")\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout) // Query base oid and return only values in applicable range\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n\ndef print_results(Map results) {\n Map fans = results?.index // Make fan indexes its own Map\n results.remove(\"index\") // Remove index information from original Map\n fans?.values?.each { index, wildvalue ->\n results?.each { wildalias, data ->\n if (data?.values?.containsKey(index)) println(\"PowerSupply_${wildvalue}.${wildalias}=${data?.values?.get(index)}\")\n }\n }\n}"}, "datapoints": [{"name": "Status", "description": "The status of the indexed power supply on the system. This is only supported for the platform where the sensor data is available.\n\nStatus Values:\n- 0: Bad\n- 1: Good\n- 2: Not Present", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "threshold": "= 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## ##INSTANCE## Failed", "alertBody": "F5 BIGIP ##HOST## ##INSTANCE## has failed (Health Status: ##VALUE##). The host is currently operating at a ##LEVEL## state.\n\nHardware Health Status Values:\n- 0: Bad\n- 1: Good\n- 2: Not Present\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Status", "title": "Power Supply Status", "verticalLabel": "status code", "min": -1.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Status", "color": "olive", "datapointName": "Status", "isVirtual": false}]}], "overviewGraphs": [{"name": "Statuses", "title": "Top 10 Power Supply Statuses", "verticalLabel": "status code", "min": -1.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "area", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Status", "isVirtual": false}]}]}

×DataSource: F5_BigIP_SSL_VIP_Certs (914)

{"name": "F5_BigIP_SSL_VIP_Certs", "description": "Tracks the certificate expiration time of VIP SSL sites.", "appliesTo": "hasCategory(\"F5Active\")", "searchKeywords": "bigip,loadbalancer,certificate,vip,ssl,f5", "displayedAs": "VIP SSL Certs", "collectionInterval": "1d", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nString hostname = hostProps.get(\"system.hostname\")\n\n// To run in debug mode, set to true\ndef debug = false\n\ndef snmpResult = Snmp.walk(hostname,\".1.3.6.1.4.1.3375.2.2.10.1.2.1.6\") // Get list of ports of all vservers\n\nLMDebugPrint(\"Raw response for ports of all vservers:\\n${snmpResult}\", debug)\n\nif (!(snmpResult?.toString()?.contains(\"Timeout\"))) { // Check for timeout on walk\n snmpResult.eachLine { line -> // Loop through each line of the Snmp.walk\n if (line.endsWith(\"443\")) { // Looking for secure ports 443 for SSL\n tokens = line.split(\" = \", 2)\n value = tokens[1]\n index = tokens[0].minus(~/.1.3.6.1.4.1.3375.2.2.10.1.2.1.6/) // Separate index to use for subsequent gets\n \n def alias = Snmp.get(hostname, \".1.3.6.1.4.1.3375.2.2.10.1.2.1.1\" + index) // Get Name\n def hexIP = Snmp.get(hostname, \".1.3.6.1.4.1.3375.2.2.10.1.2.1.3\" + index) // Get IP\n \n if (!alias.contains(\"Timeout\") && !hexIP.contains(\"Timeout\")) { // timeout check on Name and IP\n \n if ( hexIP==~ /\\w*:\\w*:\\w*:\\w*:?\\w*:?\\w*:?\\w*:?\\w*/) { // Pattern to match either IPv4 or IPv6\n parts = hexIP.split(\":\")\n \n // Convert the hexIP back to integers to get the corresponding wildvalue\n println(Integer.parseInt(parts[0], 16) + \".\" +\n Integer.parseInt(parts[1], 16) + \".\" +\n Integer.parseInt(parts[2], 16) + \".\" +\n Integer.parseInt(parts[3], 16) + \"##\" +\n alias)\n }\n // Fail if pattern match fails\n else {\n LMDebugPrint(\"${alias} (IP: ${hexIP}) does not meet requirements to create an instance. If you feel this is an error, please contact LM support.\", debug)\n return 1\n }\n } \n // Fail if timeout\n else {\n return 1\n }\n }\n }\n return 0\n}\n// Fail if timeout\nelse {\n return 1\n}\n\n\n/**\n * Helper function to print out debug messages for troubleshooting purposes.\n * @param message\n * @param debug\n */\ndef LMDebugPrint(message, debug=false) {\n if (debug) {\n println(message.toString())\n }\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport javax.net.ssl.*\nimport javax.net.ssl.X509TrustManager.*\n\ndef host = \"##WILDVALUE##\"\ndef port = \"443\"\n\nclass Results {\n static def certificates = null\n}\n\nclass EmptyX509TrustManager implements TrustManager, X509TrustManager {\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return null\n }\n public boolean isServerTrusted(java.security.cert.X509Certificate[] certs) {\n return true\n }\n public boolean isClientTrusted(java.security.cert.X509Certificate[] certs) {\n return true\n }\n public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) throws java.security.cert.CertificateException {\n Results.certificates = certs\n }\n public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) throws java.security.cert.CertificateException {\n return\n }\n}\n\ndef createSocket(host, port) {\n def sock = new Socket()\n sock.setSoTimeout(30000)\n sock.connect(new InetSocketAddress(host, port.toInteger()), 30000)\n def trustManager = new EmptyX509TrustManager()\n def context = SSLContext.getInstance(\"SSL\")\n context.init(null, [trustManager] as TrustManager[], null)\n def factory = context.getSocketFactory()\n return (SSLSocket)factory.createSocket(sock, host, port.toInteger(), true)\n}\n\ndef checkCertificateDate(String host, String port) {\n def sock = null\n try {\n sock = createSocket(host, Integer.parseInt(port))\n def request = \"GET / HTTP/1.1\\r\\nHost:${host}:${port}\\r\\nConnection:Close\\r\\nUser-Agent:SSLClient/1.0\\r\\n\\r\\n\"\n def writer = new OutputStreamWriter(sock.getOutputStream(), \"utf-8\")\n writer.write(request)\n writer.flush()\n } catch (Exception ex) {\n println(\"Error: ${ex.message}\")\n } finally {\n if (sock != null) sock.close()\n }\n}\n\ntry {\n checkCertificateDate(host, port)\n} catch (Exception e) {\n println(\"Error: ${e.message}\")\n}\n\nif (Results.certificates != null) {\n def time = Calendar.getInstance()\n time.add(Calendar.YEAR, 10) // maximum 10 years\n def expire = time.getTime()\n time.set(1970, 0, 0)\n def issue = time.getTime()\n Results.certificates.each() { cert->\n if (cert.getNotBefore().after(issue) ) issue = cert.getNotBefore()\n if (cert.getNotAfter().before(expire)) expire = cert.getNotAfter()\n }\n def now = Calendar.getInstance().getTime()\n def t1 = now.getTime()\n def t2 = expire.getTime()\n if (t1 >= t2) {\n println(\"Days=-1\")\n } else {\n println(\"Days=${(t2 - t1) / 1000 / 60 / 60 / 24}\")\n }\n} else {\n println(\"Failed to get certificate.\")\n}\nreturn 0"}, "datapoints": [{"name": "DaysToExpiration", "description": "Displays the number of days before an SSL Certificate expires.", "interpretMethod": "namevalue", "interpretExpr": "Days", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "< 21 7 3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "##INSTANCE## SSL Certificate Expiring Soon (F5 ##HOST##)", "alertBody": "The SSL certificate for site ##INSTANCE## ##DSIDESCRIPTION## on the F5 ##HOST## is about to expire (##VALUE## Days Remaining).\n\nDevice State: ##LEVEL##\n\nThis started at ##START## - or ##DURATION## ago."}], "graphs": [{"name": "Certificate Expiration", "title": "SSL VIP Certificate Expiration", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DaysToExpiration", "datapointName": "DaysToExpiration", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Expiration", "color": "orange2", "datapointName": "DaysToExpiration", "isVirtual": false}]}]}

×DataSource: F5_BigIP_System (1487)

{"name": "F5_BigIP_System", "description": "Monitors Global Statistics for F5 BIGIP Devices. Provides a general overview of system performance and health.", "appliesTo": "hasCategory(\"F5\")", "searchKeywords": "bigip,loadbalancer,system,global statistics,global,f5", "displayedAs": "Global Statistics", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\nimport com.santaba.agent.collector3.snmp.SNMPCollector\n\nint exit_code = 0 // Exit code to indicate successful or error program exit\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\nMap required_oids = [\"client_bytes_in\" : \"1.3.6.1.4.1.3375.2.1.1.2.1.3.0\",\n \"client_bytes_out\" : \"1.3.6.1.4.1.3375.2.1.1.2.1.5.0\",\n \"client_ssl_connc\" : \"1.3.6.1.4.1.3375.2.1.1.2.9.2.0\",\n \"cpu_utilization\" : \"1.3.6.1.4.1.3375.2.1.1.2.20.29.0\",\n \"client_curr_conncs\" : \"1.3.6.1.4.1.3375.2.1.1.2.1.8.0\",\n \"mem_total\" : \"1.3.6.1.4.1.3375.2.1.1.2.1.44.0\",\n \"mem_used\" : \"1.3.6.1.4.1.3375.2.1.1.2.1.45.0\",\n \"number_gets\" : \"1.3.6.1.4.1.3375.2.1.1.2.4.8.0\",\n \"number_posts\" : \"1.3.6.1.4.1.3375.2.1.1.2.4.9.0\",\n \"number_requests\" : \"1.3.6.1.4.1.3375.2.1.1.2.4.7.0\",\n \"resp_2xx_cnt\" : \"1.3.6.1.4.1.3375.2.1.1.2.4.3.0\",\n \"resp_3xx_cnt\" : \"1.3.6.1.4.1.3375.2.1.1.2.4.4.0\",\n \"resp_4xx_cnt\" : \"1.3.6.1.4.1.3375.2.1.1.2.4.5.0\",\n \"resp_5xx_cnt\" : \"1.3.6.1.4.1.3375.2.1.1.2.4.6.0\",\n \"server_curr_connc\" : \"1.3.6.1.4.1.3375.2.1.1.2.1.15.0\",\n \"server_total_connc\" : \"1.3.6.1.4.1.3375.2.1.1.2.1.14.0\",\n \"sys_uptime\" : \"1.3.6.1.4.1.3375.2.1.6.6.0\",\n \"cycles_idle\" : \"1.3.6.1.4.1.3375.2.1.1.2.1.42.0\",\n \"cycles_sleep\" : \"1.3.6.1.4.1.3375.2.1.1.2.1.43.0\",\n \"cycles_total\" : \"1.3.6.1.4.1.3375.2.1.1.2.1.41.0\",\n \"connections_total\" : \"1.3.6.1.4.1.3375.2.1.1.2.1.7.0\"]\ntry {\n required_oids?.each { name, oid ->\n String returned_value = query_oid(oid, query_details) // Call function to query the base system oid\n if (returned_value != null && returned_value != \"\") { // Confirm that we received valid data from query\n if (name ==~ \"sys_uptime\") returned_value = (new SNMPCollector()._convertTime(returned_value))?.toInteger() / 100 // Convert date time stamp to seconds\n println(\"${name}=${returned_value}\")\n } else { // If invalid data is received, print error and set status to 1\n println(\"FATAL ERROR: Failed to query F5 Memory Metrics at OID $index.\\nReturned SNMP value from ${query_details?.host} was invalid ($returned_values)\")\n exit_code = 1\n }\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.get(details?.host, oid, details?.props, details?.timeout)\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}"}, "datapoints": [{"name": "404Alert", "description": "If number of 200 responses is > 10/sec, then calculate the percent of 404 responses as:\n404s/(200s+404s)*100\nelse return 0", "interpretMethod": "expression", "interpretExpr": "if(gt(Resp2xxCnt,10),100*Resp4xxCnt/(Resp2xxCnt+Resp4xxCnt),0)", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": ">= 15", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertSubject": "F5 ##HOST## High 404 Not Found Errors", "alertBody": "F5 ##HOST## is serving ##VALUE## percent 404s.\n\nDevice State: ##LEVEL##\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "404Percentage", "description": "Displays the percentage of error messages that are 404 Not Found HTTP Responses.", "interpretMethod": "expression", "interpretExpr": "Resp4xxCnt / (Resp2xxCnt + Resp4xxCnt) * 100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CPUUtilization", "description": "This is average usage ratio of CPU for the system in the last one minute. It is calculated by (sum of deltas for user, niced, system)/(sum of deltas of user, niced, system, idle, irq, softirq, and iowait), where each delta is the difference for each stat over the last 1-minute interval", "interpretMethod": "namevalue", "interpretExpr": "cpu_utilization", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ClientBytesIn", "description": "The number of bytes received by the system from client-side.", "interpretMethod": "namevalue", "interpretExpr": "client_bytes_in", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ClientBytesOut", "description": "The number of bytes sent to client-side from the system.", "interpretMethod": "namevalue", "interpretExpr": "client_bytes_out", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ClientCurrentConnections", "description": "The current connections from client-side to the system.", "interpretMethod": "namevalue", "interpretExpr": "client_curr_conncs", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ClientSSLConnections", "description": "The current number of concurrent connections with established SSL sessions being maintained by the filter", "interpretMethod": "namevalue", "interpretExpr": "client_ssl_connc", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ConnectionsTotal", "description": "The total connections from client-side to the system.", "interpretMethod": "namevalue", "interpretExpr": "connections_total", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CyclesIdle", "description": "Traffic management CPU usage. The cycles spent polling with no traffic.", "interpretMethod": "namevalue", "interpretExpr": "cycles_idle", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CyclesSleep", "description": "Traffic management CPU usage. The cycles yielded.", "interpretMethod": "namevalue", "interpretExpr": "cycles_sleep", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CyclesTotal", "description": "Traffic management CPU usage. The total cycles spent in traffic management.", "interpretMethod": "namevalue", "interpretExpr": "cycles_total", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemoryTotal", "description": "The total memory available in bytes for TMM (Traffic Management Module).", "interpretMethod": "namevalue", "interpretExpr": "mem_total", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemoryUsage", "description": "Calculates the memory utilization percentage.", "interpretMethod": "expression", "interpretExpr": "MemoryUsed / MemoryTotal * 100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": ">= 90 95", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertSubject": "F5 ##HOST## High Memory Utilization", "alertBody": "F5 ##HOST## is reporting memory usage of ##VALUE## percent.\n\nDevice State: ##LEVEL##\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "MemoryUsed", "description": "The memory in use in bytes for TMM (Traffic Management Module).", "interpretMethod": "namevalue", "interpretExpr": "mem_used", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NumberOfGets", "description": "The total number of HTTP get requests.", "interpretMethod": "namevalue", "interpretExpr": "number_gets", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NumberOfPosts", "description": "The total number of HTTP post requests.", "interpretMethod": "namevalue", "interpretExpr": "number_posts", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NumberOfRequests", "description": "The total number of HTTP requests.", "interpretMethod": "namevalue", "interpretExpr": "number_requests", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Resp2xxCnt", "description": "The number of server-side responses in range of 200 to 206 (successful responses).", "interpretMethod": "namevalue", "interpretExpr": "resp_2xx_cnt", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Resp3xxCnt", "description": "The number of server-side responses in range of 300 to 307 (redirection responses).", "interpretMethod": "namevalue", "interpretExpr": "resp_3xx_cnt", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Resp4xxCnt", "description": "The number of server-side responses in range of 400 to 417 (client errors).", "interpretMethod": "namevalue", "interpretExpr": "resp_4xx_cnt", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Resp5xxCnt", "description": "The number of server-side responses in range of 500 to 505 (server errors).", "interpretMethod": "namevalue", "interpretExpr": "resp_5xx_cnt", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServerCurrentConncections", "description": "The current connections from server-side to the system.", "interpretMethod": "namevalue", "interpretExpr": "server_curr_connc", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServerTotalConnections", "description": "The total connections from server-side to the system.", "interpretMethod": "namevalue", "interpretExpr": "server_total_connc", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SystemUptime", "description": "The system up time in seconds since boot.", "interpretMethod": "namevalue", "interpretExpr": "sys_uptime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "404 Errors", "title": "HTTP 404 Errors (Not Found)", "verticalLabel": "%", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "404Percentage", "datapointName": "404Percentage", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "404 Errors", "color": "orange2", "datapointName": "404Percentage", "isVirtual": false}]}, {"name": "CPU Utilization", "title": "CPU Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CPUUtilization", "datapointName": "CPUUtilization", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "CPU", "color": "silver", "datapointName": "CPUUtilization", "isVirtual": false}]}, {"name": "Connection Rate", "title": "Connection Rate", "verticalLabel": "connections/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ConnectionsTotal", "datapointName": "ConnectionsTotal", "consolidationFn": "average"}, {"name": "ServerTotalConnections", "datapointName": "ServerTotalConnections", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Client", "color": "fuchsia", "datapointName": "ConnectionsTotal", "isVirtual": false}, {"type": "stack", "legend": "Server", "color": "purple", "datapointName": "ServerTotalConnections", "isVirtual": false}]}, {"name": "Connections", "title": "Connections", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ClientCurrentConnections", "datapointName": "ClientCurrentConnections", "consolidationFn": "average"}, {"name": "ClientSSLConnections", "datapointName": "ClientSSLConnections", "consolidationFn": "average"}, {"name": "ServerCurrentConncections", "datapointName": "ServerCurrentConncections", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Client", "color": "orange2", "datapointName": "ClientCurrentConnections", "isVirtual": false}, {"type": "stack", "legend": "Client SSL", "color": "yellow", "datapointName": "ClientSSLConnections", "isVirtual": false}, {"type": "stack", "legend": "Server", "color": "red", "datapointName": "ServerCurrentConncections", "isVirtual": false}]}, {"name": "Memory", "title": "Total/Free Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "MemoryTotal", "datapointName": "MemoryTotal", "consolidationFn": "average"}, {"name": "MemoryUsed", "datapointName": "MemoryUsed", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Total", "color": "lime", "datapointName": "MemoryTotal", "isVirtual": false}, {"type": "area", "legend": "Used", "color": "green", "datapointName": "MemoryUsed", "isVirtual": false}]}, {"name": "Memory Utilization", "title": "Memory Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "MemoryUsage", "datapointName": "MemoryUsage", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Memory", "color": "yellow", "datapointName": "MemoryUsage", "isVirtual": false}]}, {"name": "Requests", "title": "HTTP Requests", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "NumberOfGets", "datapointName": "NumberOfGets", "consolidationFn": "average"}, {"name": "NumberOfPosts", "datapointName": "NumberOfPosts", "consolidationFn": "average"}, {"name": "NumberOfRequests", "datapointName": "NumberOfRequests", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Get", "color": "olive", "datapointName": "NumberOfGets", "isVirtual": false}, {"type": "stack", "legend": "Post", "color": "teal", "datapointName": "NumberOfPosts", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "NumberOfRequests", "isVirtual": false}]}, {"name": "Responses Codes", "title": "HTTP Responses Codes", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Resp2xxCnt", "datapointName": "Resp2xxCnt", "consolidationFn": "average"}, {"name": "Resp3xxCnt", "datapointName": "Resp3xxCnt", "consolidationFn": "average"}, {"name": "Resp4xxCnt", "datapointName": "Resp4xxCnt", "consolidationFn": "average"}, {"name": "Resp5xxCnt", "datapointName": "Resp5xxCnt", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Successful (200)", "color": "olive", "datapointName": "Resp2xxCnt", "isVirtual": false}, {"type": "stack", "legend": "Redirected (300)", "color": "yellow", "datapointName": "Resp3xxCnt", "isVirtual": false}, {"type": "stack", "legend": "Client Error (400)", "color": "orange2", "datapointName": "Resp4xxCnt", "isVirtual": false}, {"type": "stack", "legend": "Server Error (500)", "color": "red", "datapointName": "Resp5xxCnt", "isVirtual": false}]}, {"name": "TMM CPU Cycles", "title": "TMM CPU Cycles", "verticalLabel": "count", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CyclesIdle", "datapointName": "CyclesIdle", "consolidationFn": "average"}, {"name": "CyclesSleep", "datapointName": "CyclesSleep", "consolidationFn": "average"}, {"name": "CyclesTotal", "datapointName": "CyclesTotal", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "CyclesActive", "expr": "CyclesTotal - (CyclesIdle + CyclesSleep)"}], "lines": [{"type": "stack", "legend": "Active", "color": "navy", "datapointName": "CyclesActive", "isVirtual": true}, {"type": "stack", "legend": "Idle", "color": "orange2", "datapointName": "CyclesIdle", "isVirtual": false}, {"type": "stack", "legend": "Sleep", "color": "red", "datapointName": "CyclesSleep", "isVirtual": false}, {"type": "line", "legend": "CyclesTotal", "color": "black", "datapointName": "CyclesTotal", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ClientBytesIn", "datapointName": "ClientBytesIn", "consolidationFn": "average"}, {"name": "ClientBytesOut", "datapointName": "ClientBytesOut", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "aqua", "datapointName": "ClientBytesIn", "isVirtual": false}, {"type": "stack", "legend": "Transmitted", "color": "lime", "datapointName": "ClientBytesOut", "isVirtual": false}]}, {"name": "Uptime", "title": "System Uptime", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SystemUptime", "datapointName": "SystemUptime", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Uptime", "color": "gray", "datapointName": "SystemUptime", "isVirtual": false}]}]}

×DataSource: F5_BigIP_TMM (1485)

{"name": "F5_BigIP_TMM", "description": "Monitors status of F5 BIGIP Traffic Management Microkernel.", "appliesTo": "hasCategory(\"F5Active\")", "searchKeywords": "bigip,loadbalancer,traffic management microkernel,tmm,network,f5", "displayedAs": "Traffic Management Microkernel", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n def oid_values = query_oid(\"1.3.6.1.4.1.3375.2.1.8.2.3.1.1\", query_details) // Call function to query the base system oid\n if (oid_values instanceof Map && oid_values != null && !(oid_values?.isEmpty())) { // Confirm that we received valid data from query\n oid_values?.each{println(\"TMM_${it?.value}##TMM_${it?.value}##\")} // Print active discovery instances\n } else { // If invalid data is received, print error and set status to 1\n println(\"FATAL ERROR: Failed to query F5 Traffic Management Microkernel IDs. Returned SNMP value from ${query_details?.host} was invalid ($oid_values)\")\n exit_code = 1\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout) // Query base oid and return\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0 // Exit code to indicate successful or error program exit\nboolean index_found = true\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n Map results = [\"ids\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.1\"],\n \"client_pkts_in\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.6\"],\n \"client_bytes_in\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.7\"],\n \"client_pkts_out\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.8\"],\n \"client_bytes_out\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.9\"],\n \"client_max_connc\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.10\"],\n \"client_total_connc\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.11\"],\n \"client_curr_connc\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.12\"],\n \"server_pkts_in\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.13\"],\n \"server_bytes_in\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.14\"],\n \"server_pkts_out\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.15\"],\n \"server_bytes_out\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.16\"],\n \"server_max_connc\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.17\"],\n \"server_total_connc\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.18\"],\n \"server_curr_connc\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.19\"],\n \"tmm_redirect\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.26\"],\n \"memory_error\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.27\"],\n \"total_cycles\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.28\"],\n \"idle_cycles\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.29\"],\n \"sleep_cycles\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.30\"],\n \"memory_total\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.31\"],\n \"memory_used\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.32\"],\n \"dropped_pkts\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.33\"],\n \"pkt_errors_in\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.34\"],\n \"pkt_errors_out\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.35\"],\n \"http_requests\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.8.2.3.1.36\"]]\n results?.each { name, details_map ->\n def query_results = query_oid(details_map?.oid, query_details) // Call function to query the base system oid\n if (query_results instanceof Map && query_results != null && !(query_results?.isEmpty())) { // Confirm that we received valid data from query\n details_map?.put(\"values\", query_results)\n } else { // If invalid data is received, print error and set status to 1\n println(\"ERROR: Failed to query metrics for TMM OID ${details_map?.oid}.\\nReturned SNMP value from ${query_details?.host} was invalid ($query_results)\")\n if (name ==~ \"index\") index_found = false\n exit_code = 1\n }\n }\n if (index_found) {\n print_results(results)\n } else {\n println(\"FATAL ERROR: Unable to determine TMM IDs. Unable to proceed with data collection.\")\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout) // Query base oid and return only values in applicable range\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n\ndef print_results(Map results) {\n Map tmms = results?.ids // Make fan indexes its own Map\n results.remove(\"ids\") // Remove index information from original Map\n tmms?.values?.each { index, wildvalue ->\n results?.each { wildalias, data ->\n if (data?.values?.containsKey(index)) println(\"TMM_${wildvalue}.${wildalias}=${data?.values?.get(index)}\")\n }\n }\n}"}, "datapoints": [{"name": "ClientBytesIn", "description": "The number of bytes received by the system from client-side.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.client_bytes_in", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ClientBytesOut", "description": "The number of bytes sent to client-side from the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.client_bytes_out", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ClientCurrentConncections", "description": "The current connections from client-side to the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.client_curr_connc", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ClientMaxConncections", "description": "The maximum connections from client-side to the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.client_max_connc", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ClientPacketsIn", "description": "The number of packets received by the system from client-side.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.client_pkts_in", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ClientPacketsOut", "description": "The number of packets sent to client-side from the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.client_pkts_out", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ClientTotalConncections", "description": "The total connections from client-side to the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.client_total_connc", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DroppedPackets", "description": "The total dropped packets.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.dropped_pkts", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "threshold": ">= 10 50", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## ##INSTANCE## Packet Loss", "alertBody": "F5 BIGIP ##HOST## ##INSTANCE## is experiencing packet loss (##VALUE## Packets Dropped/Second Total). The host is currently operating at a ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "HTTPRequests", "description": "The total number of HTTP requests to the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.http_requests", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IdleCycles", "description": "Traffic management CPU usage. The cycles spent polling with no traffic.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.idle_cycles", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemoryErrors", "description": "The connections could not be created because memory was not available.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.memory_error", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "threshold": ">= 10 50", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## ##INSTANCE## Memory Errors", "alertBody": "F5 BIGIP ##HOST## ##INSTANCE## is experiencing memory errors (##VALUE## Errors/Second Total). The host is currently operating at a ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "MemoryTotal", "description": "The total memory available in bytes for TMM (Traffic Management Module).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.memory_total", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemoryUsed", "description": "The memory in use in bytes for TMM (Traffic Management Module).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.memory_used", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketErrorsIn", "description": "The total incoming packet errors for the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pkt_errors_in", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "threshold": ">= 10 50", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## ##INSTANCE## Receiving Inbound Packet Errors", "alertBody": "F5 BIGIP ##HOST## ##INSTANCE## is receiving inbound packet errors (##VALUE## Packet Errors/Second Total). The host is currently operating at a ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "PacketErrorsOut", "description": "The total outgoing packet errors for the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pkt_errors_out", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "threshold": ">= 10 50", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "F5 BIGIP ##HOST## ##INSTANCE## Transmitting Outbound Packet Errors", "alertBody": "F5 BIGIP ##HOST## ##INSTANCE## is transmitting outbound packet errors (##VALUE## Packet Errors/Second Total). The host is currently operating at a ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "Redirected", "description": "The connections that were redirected to a different TMM in the cluster.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.tmm_redirect", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServerBytesIn", "description": "The number of bytes received by the system from server-side.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.server_bytes_in", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServerBytesOut", "description": "The number of bytes sent to server-side from the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.server_bytes_out", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServerCurrentConnections", "description": "The current connections from server-side to the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.server_curr_connc", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServerMaxConnections", "description": "The maximum connections from server-side to the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.server_max_connc", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServerPacketsIn", "description": "The number of packets received by the system from server-side.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.server_pkts_in", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServerPacketsOut", "description": "The number of packets sent to server-side from the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.server_pkts_out", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ServerTotalConnections", "description": "The total connections from server-side to the system.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.server_total_connc", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SleepCycles", "description": "Traffic management CPU usage. The cycles yielded (uniprocessor only).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sleep_cycles", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalCycles", "description": "Traffic management CPU usage. The total cycles spent in traffic management.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.total_cycles", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "CPU Cycles", "title": "TMM CPU Cycles", "verticalLabel": "count", "min": 0.0, "displayPriority": 14, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "IdleCycles", "datapointName": "IdleCycles", "consolidationFn": "average"}, {"name": "SleepCycles", "datapointName": "SleepCycles", "consolidationFn": "average"}, {"name": "TotalCycles", "datapointName": "TotalCycles", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "ActiveCycles", "expr": "TotalCycles - (IdleCycles + SleepCycles)"}], "lines": [{"type": "stack", "legend": "Active", "color": "olive", "datapointName": "ActiveCycles", "isVirtual": true}, {"type": "stack", "legend": "Idle", "color": "green", "datapointName": "IdleCycles", "isVirtual": false}, {"type": "stack", "legend": "Sleep", "color": "lime", "datapointName": "SleepCycles", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "TotalCycles", "isVirtual": false}]}, {"name": "Client Connections", "title": "TMM Client Connections", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ClientCurrentConncections", "datapointName": "ClientCurrentConncections", "consolidationFn": "average"}, {"name": "ClientTotalConncections", "datapointName": "ClientTotalConncections", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Current", "color": "purple", "datapointName": "ClientCurrentConncections", "isVirtual": false}, {"type": "area", "legend": "Total", "color": "fuchsia", "datapointName": "ClientTotalConncections", "isVirtual": false}]}, {"name": "Client Max Connections", "title": "TMM Client Maximum Connections", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ClientMaxConncections", "datapointName": "ClientMaxConncections", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Maximum", "color": "yellow", "datapointName": "ClientMaxConncections", "isVirtual": false}]}, {"name": "Client Traffic (Bytes)", "title": "TMM Client Traffic (Bytes)", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "ClientBytesIn", "datapointName": "ClientBytesIn", "consolidationFn": "average"}, {"name": "ClientBytesOut", "datapointName": "ClientBytesOut", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "navy", "datapointName": "ClientBytesIn", "isVirtual": false}, {"type": "stack", "legend": "Transmitted", "color": "olive", "datapointName": "ClientBytesOut", "isVirtual": false}]}, {"name": "Client Traffic (Packets)", "title": "TMM Client Traffic (Packets)", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ClientPacketsIn", "datapointName": "ClientPacketsIn", "consolidationFn": "average"}, {"name": "ClientPacketsOut", "datapointName": "ClientPacketsOut", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "aqua", "datapointName": "ClientPacketsIn", "isVirtual": false}, {"type": "stack", "legend": "Transmitted", "color": "lime", "datapointName": "ClientPacketsOut", "isVirtual": false}]}, {"name": "Dropped Packets", "title": "TMM Dropped Packets", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DroppedPackets", "datapointName": "DroppedPackets", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Dropped", "color": "yellow", "datapointName": "DroppedPackets", "isVirtual": false}]}, {"name": "HTTP Requests", "title": "TMM HTTP Requests", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "HTTPRequests", "datapointName": "HTTPRequests", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "HTTP Requests", "color": "lime", "datapointName": "HTTPRequests", "isVirtual": false}]}, {"name": "Memory Errors", "title": "TMM Memory Errors", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 13, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "MemoryErrors", "datapointName": "MemoryErrors", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Memory Errors", "color": "red2", "datapointName": "MemoryErrors", "isVirtual": false}]}, {"name": "Memory Usage", "title": "TMM Memory Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 12, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "MemoryTotal", "datapointName": "MemoryTotal", "consolidationFn": "average"}, {"name": "MemoryUsed", "datapointName": "MemoryUsed", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Total", "color": "yellow", "datapointName": "MemoryTotal", "isVirtual": false}, {"type": "area", "legend": "Used", "color": "orange2", "datapointName": "MemoryUsed", "isVirtual": false}]}, {"name": "Packet Errors", "title": "TMM Packet Errors", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PacketErrorsIn", "datapointName": "PacketErrorsIn", "consolidationFn": "average"}, {"name": "PacketErrorsOut", "datapointName": "PacketErrorsOut", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "orange2", "datapointName": "PacketErrorsIn", "isVirtual": false}, {"type": "stack", "legend": "Transmitted", "color": "red2", "datapointName": "PacketErrorsOut", "isVirtual": false}]}, {"name": "Redirects", "title": "TMM Redirects", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 15, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Redirected", "datapointName": "Redirected", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Redirects", "color": "red1", "datapointName": "Redirected", "isVirtual": false}]}, {"name": "Server Connections", "title": "TMM Server Connections", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ServerCurrentConnections", "datapointName": "ServerCurrentConnections", "consolidationFn": "average"}, {"name": "ServerTotalConnections", "datapointName": "ServerTotalConnections", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Current", "color": "navy", "datapointName": "ServerCurrentConnections", "isVirtual": false}, {"type": "area", "legend": "Total", "color": "aqua", "datapointName": "ServerTotalConnections", "isVirtual": false}]}, {"name": "Server Max Connections", "title": "TMM Server Maximum Connections", "verticalLabel": "count", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ServerMaxConnections", "datapointName": "ServerMaxConnections", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Maximum", "color": "orange2", "datapointName": "ServerMaxConnections", "isVirtual": false}]}, {"name": "Server Traffic (Bytes)", "title": "TMM Server Traffic (Bytes)", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "ServerBytesIn", "datapointName": "ServerBytesIn", "consolidationFn": "average"}, {"name": "ServerBytesOut", "datapointName": "ServerBytesOut", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "navy", "datapointName": "ServerBytesIn", "isVirtual": false}, {"type": "stack", "legend": "Transmitted", "color": "olive", "datapointName": "ServerBytesOut", "isVirtual": false}]}, {"name": "Server Traffic (Packets)", "title": "TMM Server Traffic (Packets)", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ServerPacketsIn", "datapointName": "ServerPacketsIn", "consolidationFn": "average"}, {"name": "ServerPacketsOut", "datapointName": "ServerPacketsOut", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "aqua", "datapointName": "ServerPacketsIn", "isVirtual": false}, {"type": "stack", "legend": "Transmitted", "color": "lime", "datapointName": "ServerPacketsOut", "isVirtual": false}]}], "overviewGraphs": [{"name": "Client Connections", "title": "Top 10 Client Connections", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ClientCurrentConncections", "datapointName": "ClientCurrentConncections", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "ClientCurrentConncections", "isVirtual": false}]}, {"name": "Client Traffic (Bytes)", "title": "Top 10 Client Traffic (Bytes)", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "ClientBytesIn", "datapointName": "ClientBytesIn", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "ClientBytesOut", "datapointName": "ClientBytesOut", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Received", "color": "silver", "datapointName": "ClientBytesIn", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Transmitted", "color": "silver", "datapointName": "ClientBytesOut", "isVirtual": false}]}, {"name": "Client Traffic (Packets)", "title": "Top 10 Client Traffic (Packets)", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ClientPacketsIn", "datapointName": "ClientPacketsIn", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "ClientPacketsOut", "datapointName": "ClientPacketsOut", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Received", "color": "silver", "datapointName": "ClientPacketsIn", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Transmitted", "color": "silver", "datapointName": "ClientPacketsOut", "isVirtual": false}]}, {"name": "Dropped Packets", "title": "Top 10 Dropped Packets", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "DroppedPackets", "datapointName": "DroppedPackets", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "DroppedPackets", "isVirtual": false}]}, {"name": "HTML Requests", "title": "Top 10 HTML Requests", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "HTTPRequests", "datapointName": "HTTPRequests", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "HTTPRequests", "isVirtual": false}]}, {"name": "Memory Errors", "title": "Top 10 Memory Errors", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "MemoryErrors", "datapointName": "MemoryErrors", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "MemoryErrors", "isVirtual": false}]}, {"name": "Memory Usage", "title": "Top 10 Memory Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "MemoryUsed", "datapointName": "MemoryUsed", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "MemoryUsed", "isVirtual": false}]}, {"name": "Packet Errors", "title": "Top 10 Packet Errors", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "PacketErrorsIn", "datapointName": "PacketErrorsIn", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "PacketErrorsOut", "datapointName": "PacketErrorsOut", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Received", "color": "silver", "datapointName": "PacketErrorsIn", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Transmitted", "color": "silver", "datapointName": "PacketErrorsOut", "isVirtual": false}]}, {"name": "Redirects", "title": "Top 10 Redirects", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 12, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Redirected", "datapointName": "Redirected", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Redirected", "isVirtual": false}]}, {"name": "Server Connections", "title": "Top 10 Server Connections", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ServerCurrentConnections", "datapointName": "ServerCurrentConnections", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "ServerCurrentConnections", "isVirtual": false}]}, {"name": "Server Traffic (Bytes)", "title": "Top 10 Server Traffic (Bytes)", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "ServerBytesIn", "datapointName": "ServerBytesIn", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "ServerBytesOut", "datapointName": "ServerBytesOut", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Received", "color": "silver", "datapointName": "ServerBytesIn", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Transmitted", "color": "silver", "datapointName": "ServerBytesOut", "isVirtual": false}]}, {"name": "Server Traffic (Packets)", "title": "Top 10 Server Traffic (Packets)", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ServerPacketsIn", "datapointName": "ServerPacketsIn", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "ServerPacketsOut", "datapointName": "ServerPacketsOut", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Received", "color": "silver", "datapointName": "ServerPacketsIn", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Transmitted", "color": "silver", "datapointName": "ServerPacketsOut", "isVirtual": false}]}]}

×DataSource: F5_BigIP_Temperature (1486)

{"name": "F5_BigIP_Temperature", "description": "Monitors the status of F5 BIGIP Indexed Chassis Temperatures (in degrees Celsius).", "appliesTo": "hasCategory(\"F5\")", "searchKeywords": "bigip,temp,loadbalancer,temperature,chassis,f5", "displayedAs": "Temperature", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\nint exit_code = 0\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n def oid_values = query_oid(\"1.3.6.1.4.1.3375.2.1.3.2.3.2.1.1\", query_details) // Call function to query the base system oid\n if (oid_values instanceof Map && oid_values != null && !(oid_values?.isEmpty())) { // Confirm that we received valid data from query\n oid_values?.each{println(\"Temperature_${it?.value}##Temperature_${it?.value}##Temperature Index ${it?.value}####\")} // Print active discovery instances\n } else { // If invalid data is received, print error and set status to 1\n println(\"FATAL ERROR: Failed to query F5 Chassis Temperature Indexes. Returned SNMP value from ${query_details?.host} was invalid ($oid_values)\")\n exit_code = 1\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout) // Query base oid and return\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nint exit_code = 0 // Exit code to indicate successful or error program exit\nboolean index_found = true\nMap query_details = [\"host\" : hostProps.get(\"system.hostname\"), // Hostname stored in LM Portal\n \"props\" : hostProps.toProperties(), // All host properties (stored as Properties)\n \"timeout\" : 10000] // Time out duration (10 seconds)\ntry {\n Map results = [\"index\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.3.2.3.2.1.1\"],\n \"temp\" : [\"oid\" : \"1.3.6.1.4.1.3375.2.1.3.2.3.2.1.2\"]]\n results?.each { name, details_map ->\n def query_results = query_oid(details_map?.oid, query_details) // Call function to query the base system oid\n if (query_results instanceof Map && query_results != null && !(query_results?.isEmpty())) { // Confirm that we received valid data from query\n details_map?.put(\"values\", query_results)\n } else { // If invalid data is received, print error and set status to 1\n println(\"ERROR: Failed to query metrics for Temperature OID ${details_map?.oid}.\\nReturned SNMP value from ${query_details?.host} was invalid ($query_results)\")\n if (name ==~ \"index\") index_found = false\n exit_code = 1\n }\n }\n if (index_found) {\n print_results(results)\n } else {\n println(\"FATAL ERROR: Unable to determine Temperature Indexes. Unable to proceed with data collection.\")\n }\n} catch (Exception err) { // If Script error occurred, print error message and set status to 1\n println(\"FATAL ERROR: ${err?.message}\")\n exit_code = 1\n}\nreturn exit_code // Exit the program with success (0) or failure (1) status code\n\ndef query_oid(String oid, Map details) {\n try {\n return Snmp.walkAsMap(details?.host, oid, details?.props, details?.timeout) // Query base oid and return only values in applicable range\n } catch (Exception err) { // Print error message if script fails query\n println(\"FATAL ERROR: Failed to query OID $oid.\\n${err?.message}\")\n }\n}\n\ndef print_results(Map results) {\n Map fans = results?.index // Make fan indexes its own Map\n results.remove(\"index\") // Remove index information from original Map\n fans?.values?.each { index, wildvalue ->\n results?.each { wildalias, data ->\n if (data?.values?.containsKey(index)) println(\"Temperature_${wildvalue}.${wildalias}=${data?.values?.get(index)}\")\n }\n }\n}"}, "datapoints": [{"name": "Temp", "description": "The chassis temperature (in Celsius) of the indexed sensor on the system. This is only supported for the platform where the sensor data is available.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.temp", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Temperature", "title": "Temperature", "verticalLabel": "\u00b0C", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Temp", "datapointName": "Temp", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Temperature", "color": "red", "datapointName": "Temp", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Temperatures", "title": "Top 10 Temperatures", "verticalLabel": "\u00b0C", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Temp", "datapointName": "Temp", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Temp", "isVirtual": false}]}]}

×DataSource: Cisco_HyperFlex_HypervisorVMS (305)

{"name": "Cisco_HyperFlex_HypervisorVMS", "description": "Datasource determines metrics for Cisco HyperFlex Hypervisor Virtual Machines. Data includes the state of the Virtual Machine and the Guest OS, the overall available and consumed storage, and an indicator if the Virtual Machine was created via a template.", "appliesTo": "hasCategory(\"CiscoHyperFlex\")", "searchKeywords": "hyperflex,hypervisor,cisco,vms", "displayedAs": "HyperFlex Hypervisor VMS", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n *\n * Cisco HyperFlex REST API Reference:\n * https://developer.cisco.com/docs/ucs-dev-center-hyperflex/#!core-functionalities\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.http.HTTP\nimport groovy.json.JsonBuilder\nimport groovy.json.JsonSlurper\n\ndebug = false\n\nhostname = hostProps.get(\"system.hostname\")\nuser = hostProps.get(\"cisco.hx.user\") ?: hostProps.get(\"esx.user\")\npass = hostProps.get(\"cisco.hx.pass\") ?: hostProps.get(\"esx.pass\")\ncollector_platform = hostProps.get(\"system.collectorplatform\")\n\nkeyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\nkeyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\ndef success = false\nhttp_client = HTTP.open(hostname, 443)\ntry {\n\n def hosts = httpGET(\"/coreapi/v1/hypervisor/hosts\")\n if (hosts != null && http_client.getStatusCode() == 200) {\n hosts.each { host ->\n def hostId = host.identity?.uuid\n def hypervisorHostname = host.hostName\n if (hostId != null) {\n def vms = httpGET(\"/coreapi/v1/hypervisor/hosts/${hostId}/vms\")\n if (vms != null && vms != [] && http_client.getStatusCode() == 200) {\n\n vms?.each {\n if (it?.containsKey(\"vmid\") && it?.containsKey(\"vmName\")) {\n Map encoded_instance_props = [\"auto.cisco.hyperflex.hypervisor.hostname\" : hypervisorHostname,\n \"auto.cisco.hyperflex.hypervisor.vms.path\" : it?.path,\n \"auto.cisco.hyperflex.hypervisor.vms.ip\" : it?.vmIp?.ip,\n \"auto.cisco.hyperflex.hypervisor.vms.guest_os\": it?.guestOsName]\n List encoded_instance_props_array = encoded_instance_props.collect() { property, value -> URLEncoder.encode(property.toString()) + \"=\" + URLEncoder.encode(value.toString()) }\n print(\"${it?.vmid?.replaceAll(\":\", \"-\")}##${it?.vmName}##${it?.path} - ${it?.guestOsName}####${encoded_instance_props_array?.join(\"&\")}\")\n \n def vmEri = [it?.vmid]\n \n // Add universal eri\n if (it?.vmid?.contains(\"-\")) {\n vmEri << hostId + \"--vm-\" + it?.vmid?.tokenize(\"-\")[-1]\n }\n \n println(\"&predef.externalResourceID=${eriPreProcessor(vmEri, keyNamespace, keyBlacklist)}&predef.externalResourceType=VirtualMachine\")\n\n } \n }\n success = true\n } else {\n vms = httpGET(\"/rest/virtplatform/vms?entityType=VIRTCLUSTER\")\n\n if (vms != null && vms != [] && http_client.getStatusCode() == 200) {\n vms?.each { vm ->\n if (vm?.containsKey(\"id\") && vm?.containsKey(\"name\")) {\n\n def wildvalue = vm?.id?.replaceAll(\":\", \"-\")\n def wildalias = vm?.name\n\n vm.each {\n k, v ->\n if (k == \"config.guestFullName\") {\n println \"$k=$v\"\n vmOs = v\n } else if (k == \"guest.ipAddress\") {\n println \"$k=$v\"\n vmIp = v\n } else if (k == \"summary.config.vmPathName\") {\n\n println \"$k=$v\"\n vmPath = v\n }\n }\n\n def description = \"${vmPath} - ${vmOs}\"\n\n Map encoded_instance_props = [\"auto.cisco.hyperflex.hypervisor.hostname\" : hypervisorHostname,\n \"auto.cisco.hyperflex.hypervisor.vms.path\" : vmPath,\n \"auto.cisco.hyperflex.hypervisor.vms.ip\" : vmIp,\n \"auto.cisco.hyperflex.hypervisor.vms.guest_os\": vmOs]\n\n List encoded_instance_props_array = encoded_instance_props.collect() { property, value -> URLEncoder.encode(property.toString()) + \"=\" + URLEncoder.encode(value.toString()) }\n\n print(\"${wildvalue}##${wildalias}##${description}####${encoded_instance_props_array?.join(\"&\")}\")\n\n def vmEri = [vm?.id]\n \n // Add universal eri\n if (vm?.id?.contains(\"-\")) {\n vmEri << hostId + \"--vm-\" + vm.id.tokenize(\"-\")[-1]\n }\n \n println(\"&predef.externalResourceID=${eriPreProcessor(vmEri, keyNamespace, keyBlacklist)}&predef.externalResourceType=VirtualMachine\")\n }\n }\n success = true\n }\n }\n }\n }\n }\n} catch (Exception e) {\n println \"ERROR: see debug output:\\n\\t${e.message}\"\n} finally {\n http_client.close()\n}\n\nreturn success ? 0 : 1\n\n///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Helper function that executes HTTP GETS\n * @param endpoint\n * @return\n */\ndef httpGET(String endpoint) {\n\n if (debug) {\n println \"-- DEBUG: Entered httpGET method\\n\"\n }\n\n // Create HTTP Slurper Object to convert JSON to Groovy Map\n JsonSlurper slurper = new JsonSlurper()\n\n def access_token = retrieve_cached_token()\n\n if (debug) {\n println \"-- DEBUG: Using access token - ${access_token}\\n\"\n }\n\n // Set Header variables for POST request in Map\n Map headers = [\"Content-Type\": \"application/json\",\n \"Accept\" : \"application/json\"]\n\n\n headers.put(\"Authorization\", \"Bearer ${access_token}\")\n\n // Submit GET query to API Endpoint\n http_client?.get(\"https://${hostname}${endpoint}\", headers)\n\n def response = slurper?.parseText(http_client?.getResponseBody())\n\n if (response.toString().contains('Access token invalid')) {\n\n if (debug) {\n println \"-- DEBUG: Access token invalid - ${response}\\n\"\n }\n\n // update the token.\n update_cached_token()\n access_token = retrieve_cached_token()\n\n headers.put(\"Authorization\", \"Bearer ${access_token}\")\n\n // Submit GET query to API Endpoint\n http_client?.get(\"https://${hostname}${endpoint}\", headers)\n\n response = slurper?.parseText(http_client?.getResponseBody())\n }\n\n if (debug) {\n println \"-- DEBUG: Raw response - ${response}\\n\"\n }\n\n return response\n}\n\n/**\n * Helper function which queries the AAA and grabs the access_token.\n * @return access_token\n */\ndef generateToken() {\n\n if (debug) {\n println \"-- DEBUG: Entered generateToken method\\n\"\n }\n\n // Create HTTP Slurper Object for converting JSON to Groovy Map\n JsonSlurper slurper = new JsonSlurper()\n\n // Create HTTP POST Payload Object\n JsonBuilder payload = new JsonBuilder()\n\n // Set the Authorization URL as a String variable\n String auth_url = \"https://${hostname}/aaa/v1/auth?grant_type=password\"\n\n if (debug) {\n println \"-- DEBUG: auth_url - ${auth_url}\\n\"\n }\n\n // Set Header variables for POST request in Map\n Map post_headers = [\"Content-Type\": \"application/json\",\n \"Accept\" : \"application/json\"]\n\n // Build payload content in JSON format (JsonBuilder)\n payload username: user, password: pass, client_id: \"HxGuiClient\", client_secret: \"Sunnyvale\", redirect_uri: \"http://localhost:8080/aaa/redirect\"\n\n if (debug) {\n println \"-- DEBUG: Attempting with following POST headers - ${post_headers}\\n\"\n }\n if (debug) {\n println \"-- DEBUG: Attempting with following POST payload - ${payload}\\n\"\n }\n\n // Do the post and collect the response\n http_client?.post(auth_url, payload?.toString(), post_headers)\n\n // Convert the JSON response into a Groovy Map\n def http_response = slurper?.parseText(http_client?.getResponseBody())\n def token = null\n\n // Confirm that HTTP Client object was successfully created (Status Code 201)\n if (http_client?.getStatusCode() == 201 && !(http_response?.isEmpty()) && http_response != null) {\n\n if (debug) {\n println \"-- DEBUG: Successful HTTP response: - ${http_response}\\n\"\n }\n\n // Return the API token response\n token = http_response\n\n } else if (debug) {\n println \"-- DEBUG: Failed to generate HTTP Client Object with the required access tokens.\\nHTTP RESPONSE: ${http_response}\\n\"\n }\n\n return token\n}\n\n\n/**\n * Helper function which retrieves the access token out of our cache file.\n * @param host_details\n * @return access_token\n */\ndef retrieve_cached_token() {\n\n if (debug) {\n println \"-- DEBUG: Entered retrieve_cached_token method\\n\"\n }\n\n def access_token\n def filename\n\n // figure out the file path based on collector type.\n if (collector_platform == 'windows') {\n filename = 'hyperflex_tokens\\\\' + hostname + \"-hyperflex_access_token.dat\"\n } else if (collector_platform == 'linux') {\n filename = 'hyperflex_tokens/' + hostname + \"-hyperflex_access_token.dat\"\n }\n\n // set file path.\n File cacheFile = new File(filename)\n\n // if we don't have an existing cache file, make one and add a token.\n if (!(cacheFile.exists())) {\n\n if (debug) {\n println \"-- DEBUG: No cacheFile found, creating one.\\n\"\n }\n\n new File(\"hyperflex_tokens\").mkdir()\n cacheFile.createNewFile()\n\n // will need to generate new token here.\n Map new_token = generateToken()\n if (new_token != null) {\n\n if (debug) {\n println \"-- DEBUG: New token generated\\n\"\n }\n\n cacheFile << new_token?.access_token\n\n if (debug) {\n println \"-- DEBUG: New token in cacheFile: ${cacheFile.readLines()}\\n\"\n }\n }\n }\n\n access_token = cacheFile.readLines()[0]\n\n if (debug) {\n println \"-- DEBUG: Method retrieve_cached_token return: ${access_token}\\n\"\n }\n\n return access_token\n}\n\n/**\n * Helper function which takes care of updating our access token.\n * @param host_details\n */\ndef update_cached_token() {\n\n if (debug) {\n println \"-- DEBUG: Entered update_cached_token method\\n\"\n }\n\n def filename\n\n // figure out the file path based on collector type.\n if (collector_platform == 'windows') {\n filename = 'hyperflex_tokens\\\\' + hostname + \"-hyperflex_access_token.dat\"\n } else if (collector_platform == 'linux') {\n filename = 'hyperflex_tokens/' + hostname + \"-hyperflex_access_token.dat\"\n }\n\n // set file path.\n File cacheFile = new File(filename)\n\n if (debug) {\n println \"-- DEBUG: Existing cacheFile contents: ${cacheFile.readLines()}\\n\"\n }\n\n // clear the file contents\n cacheFile.text = ''\n\n if (debug) {\n println \"-- DEBUG: cacheFile cleared, new contents: ${cacheFile.readLines()}\\n\"\n }\n\n // is the cache file empty ?\n if (cacheFile.readLines().isEmpty()) {\n\n // Yes, will need to generate new token here.\n Map new_token = generateToken()\n if (new_token != null) {\n\n if (debug) {\n println \"-- DEBUG: New token generated\\n\"\n }\n\n cacheFile << new_token?.access_token\n\n if (debug) {\n println \"-- DEBUG: New token in cacheFile: ${cacheFile.readLines()}\\n\"\n }\n }\n }\n}\n\ndef eriPreProcessor(List eriList, String namespace, List blacklist) {\n def output = []\n eriList.each { eri ->\n eri = eri.toLowerCase()\n eri = eri.replace(\",\", \"_\")\n if (!blacklist.contains(eri)) {\n if (namespace) {\n namespace = namespace.replace(\",\", \"_\").replace(\"&\", \"and\")\n eri = \"${namespace}::${eri}\"\n }\n output << eri\n }\n }\n return output.join(\",\")\n}"}, "groupMethod": "ilp", "groupExpr": "auto.cisco.hyperflex.hypervisor.hostname"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n *\n * Cisco HyperFlex REST API Reference:\n * https://developer.cisco.com/docs/ucs-dev-center-hyperflex/#!core-functionalities\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.http.HTTP\nimport groovy.json.JsonBuilder\nimport groovy.json.JsonSlurper\n\ndebug = false\n\nhostname = hostProps.get(\"system.hostname\")\nuser = hostProps.get(\"cisco.hx.user\") ?: hostProps.get(\"esx.user\")\npass = hostProps.get(\"cisco.hx.pass\") ?: hostProps.get(\"esx.pass\")\ncollector_platform = hostProps.get(\"system.collectorplatform\")\n\ndef success = false\nhttp_client = HTTP.open(hostname, 443)\ntry {\n def stateMap = [\"UNKNOWN\": 0, \"RUNNING\": 1, \"OFF\": 2, \"STOPPING\": 3, \"PAUSED\": 4, \"STARTING\": 5, \"SAVING\": 6, \"RESUMING\": 7]\n def osMap = [\"UNKNOWN\": 0, \"RUNNING\": 1, \"NOTRUNNING\": 2]\n def boolMap = [\"false\": 0, \"true\": 1]\n\n def vms = httpGET(\"/coreapi/v1/hypervisor/vms\")\n\n if (vms != null && vms != [] && http_client.getStatusCode() == 200) {\n\n vms?.each { it ->\n\n if (it?.containsKey(\"vmid\")) {\n\n def wildvalue = it?.vmid?.replaceAll(\":\", \"-\")\n\n println(\"${wildvalue}.vm_state=${stateMap[it?.vmState]}\")\n println(\"${wildvalue}.guest_os_state=${osMap[it?.guestOsState]}\")\n println(\"${wildvalue}.template=${boolMap[it?.template.toString()]}\")\n println(\"${wildvalue}.storage_used=${it?.storageUsedInBytes}\")\n println(\"${wildvalue}.storage_provisioned=${it?.storageProvisionedInBytes}\")\n }\n }\n success = true\n } else if (vms == []) {\n vms = httpGET(\"/rest/virtplatform/vms?entityType=VIRTCLUSTER\")\n\n if (vms != null && vms != [] && http_client.getStatusCode() == 200) {\n vms?.each { vm ->\n if (vm?.containsKey(\"id\")) {\n\n def wildvalue = vm?.id?.replaceAll(\":\", \"-\")\n\n println \"${wildvalue}.guest_os_state=${osMap.get(vm[\"guest.guestState\"].toString().toUpperCase())}\"\n println(\"${wildvalue}.template=${boolMap[vm?.\"config.template\"]}\")\n println \"${wildvalue}.storage_used=${vm[\"summary.storage.committed\"]}\"\n println \"${wildvalue}.storage_provisioned=${(vm[\"summary.storage.committed\"].toLong() + vm[\"summary.storage.uncommitted\"].toLong())}\"\n }\n }\n }\n }\n} catch (Exception e) {\n println \"ERROR: see debug output:\\n\\t${e.message}\"\n} finally {\n http_client.close()\n}\n\nreturn success ? 0 : 1\n\n///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Helper function that executes HTTP GETS\n * @param endpoint\n * @return\n */\ndef httpGET(String endpoint) {\n\n if (debug) {\n println \"-- DEBUG: Entered httpGET method\\n\"\n }\n\n // Create HTTP Slurper Object to convert JSON to Groovy Map\n JsonSlurper slurper = new JsonSlurper()\n\n def access_token = retrieve_cached_token()\n\n if (debug) {\n println \"-- DEBUG: Using access token - ${access_token}\\n\"\n }\n\n // Set Header variables for POST request in Map\n Map headers = [\"Content-Type\": \"application/json\",\n \"Accept\" : \"application/json\"]\n\n\n headers.put(\"Authorization\", \"Bearer ${access_token}\")\n\n // Submit GET query to API Endpoint\n http_client?.get(\"https://${hostname}${endpoint}\", headers)\n\n def response = slurper?.parseText(http_client?.getResponseBody())\n\n if (response.toString().contains('Access token invalid')) {\n\n if (debug) {\n println \"-- DEBUG: Access token invalid - ${response}\\n\"\n }\n\n // update the token.\n update_cached_token()\n access_token = retrieve_cached_token()\n\n headers.put(\"Authorization\", \"Bearer ${access_token}\")\n\n // Submit GET query to API Endpoint\n http_client?.get(\"https://${hostname}${endpoint}\", headers)\n\n response = slurper?.parseText(http_client?.getResponseBody())\n }\n\n if (debug) {\n println \"-- DEBUG: Raw response - ${response}\\n\"\n }\n\n return response\n}\n\n/**\n * Helper function which queries the AAA and grabs the access_token.\n * @return access_token\n */\ndef generateToken() {\n\n if (debug) {\n println \"-- DEBUG: Entered generateToken method\\n\"\n }\n\n // Create HTTP Slurper Object for converting JSON to Groovy Map\n JsonSlurper slurper = new JsonSlurper()\n\n // Create HTTP POST Payload Object\n JsonBuilder payload = new JsonBuilder()\n\n // Set the Authorization URL as a String variable\n String auth_url = \"https://${hostname}/aaa/v1/auth?grant_type=password\"\n\n if (debug) {\n println \"-- DEBUG: auth_url - ${auth_url}\\n\"\n }\n\n // Set Header variables for POST request in Map\n Map post_headers = [\"Content-Type\": \"application/json\",\n \"Accept\" : \"application/json\"]\n\n // Build payload content in JSON format (JsonBuilder)\n payload username: user, password: pass, client_id: \"HxGuiClient\", client_secret: \"Sunnyvale\", redirect_uri: \"http://localhost:8080/aaa/redirect\"\n\n if (debug) {\n println \"-- DEBUG: Attempting with following POST headers - ${post_headers}\\n\"\n }\n if (debug) {\n println \"-- DEBUG: Attempting with following POST payload - ${payload}\\n\"\n }\n\n // Do the post and collect the response\n http_client?.post(auth_url, payload?.toString(), post_headers)\n\n // Convert the JSON response into a Groovy Map\n def http_response = slurper?.parseText(http_client?.getResponseBody())\n def token = null\n\n // Confirm that HTTP Client object was successfully created (Status Code 201)\n if (http_client?.getStatusCode() == 201 && !(http_response?.isEmpty()) && http_response != null) {\n\n if (debug) {\n println \"-- DEBUG: Successful HTTP response: - ${http_response}\\n\"\n }\n\n // Return the API token response\n token = http_response\n\n } else if (debug) {\n println \"-- DEBUG: Failed to generate HTTP Client Object with the required access tokens.\\nHTTP RESPONSE: ${http_response}\\n\"\n }\n\n return token\n}\n\n\n/**\n * Helper function which retrieves the access token out of our cache file.\n * @param host_details\n * @return access_token\n */\ndef retrieve_cached_token() {\n\n if (debug) {\n println \"-- DEBUG: Entered retrieve_cached_token method\\n\"\n }\n\n def access_token\n def filename\n\n // figure out the file path based on collector type.\n if (collector_platform == 'windows') {\n filename = 'hyperflex_tokens\\\\' + hostname + \"-hyperflex_access_token.dat\"\n } else if (collector_platform == 'linux') {\n filename = 'hyperflex_tokens/' + hostname + \"-hyperflex_access_token.dat\"\n }\n\n // set file path.\n File cacheFile = new File(filename)\n\n // if we don't have an existing cache file, make one and add a token.\n if (!(cacheFile.exists())) {\n\n if (debug) {\n println \"-- DEBUG: No cacheFile found, creating one.\\n\"\n }\n\n new File(\"hyperflex_tokens\").mkdir()\n cacheFile.createNewFile()\n\n // will need to generate new token here.\n Map new_token = generateToken()\n if (new_token != null) {\n\n if (debug) {\n println \"-- DEBUG: New token generated\\n\"\n }\n\n cacheFile << new_token?.access_token\n\n if (debug) {\n println \"-- DEBUG: New token in cacheFile: ${cacheFile.readLines()}\\n\"\n }\n }\n }\n\n access_token = cacheFile.readLines()[0]\n\n if (debug) {\n println \"-- DEBUG: Method retrieve_cached_token return: ${access_token}\\n\"\n }\n\n return access_token\n}\n\n/**\n * Helper function which takes care of updating our access token.\n * @param host_details\n */\ndef update_cached_token() {\n\n if (debug) {\n println \"-- DEBUG: Entered update_cached_token method\\n\"\n }\n\n def filename\n\n // figure out the file path based on collector type.\n if (collector_platform == 'windows') {\n filename = 'hyperflex_tokens\\\\' + hostname + \"-hyperflex_access_token.dat\"\n } else if (collector_platform == 'linux') {\n filename = 'hyperflex_tokens/' + hostname + \"-hyperflex_access_token.dat\"\n }\n\n // set file path.\n File cacheFile = new File(filename)\n\n if (debug) {\n println \"-- DEBUG: Existing cacheFile contents: ${cacheFile.readLines()}\\n\"\n }\n\n // clear the file contents\n cacheFile.text = ''\n\n if (debug) {\n println \"-- DEBUG: cacheFile cleared, new contents: ${cacheFile.readLines()}\\n\"\n }\n\n // is the cache file empty ?\n if (cacheFile.readLines().isEmpty()) {\n\n // Yes, will need to generate new token here.\n Map new_token = generateToken()\n if (new_token != null) {\n\n if (debug) {\n println \"-- DEBUG: New token generated\\n\"\n }\n\n cacheFile << new_token?.access_token\n\n if (debug) {\n println \"-- DEBUG: New token in cacheFile: ${cacheFile.readLines()}\\n\"\n }\n }\n }\n}"}, "datapoints": [{"name": "GuestOSState", "description": "Determines the Guest OS state.\n\nStatus Codes:\n0 - UNKNOWN\n1 - RUNNING\n2 - NOT RUNNING", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.guest_os_state", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "StorageFree", "description": "Free storage remaining for the Virtual Machine (measured in bytes).", "interpretMethod": "expression", "interpretExpr": "StorageProvisioned - StorageUsed", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "StorageProvisioned", "description": "Storge provisioned for the Virtual Machine (measured in bytes).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.storage_provisioned", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "StorageUsed", "description": "Storage used by the Virtual Machine (measured in bytes).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.storage_used", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "StorageUtilized", "description": "Displays the storage utilization percentage.", "interpretMethod": "expression", "interpretExpr": "(StorageUsed / StorageProvisioned) * 100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": ">= 90 95", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "Cisco HyperFlex ##HOST## Hypervisor ##INSTANCE## Reaching Capacity", "alertBody": "Cisco HyperFlex ##HOST## Hypervisor ##INSTANCE## storage is currently ##VALUE##% consumed and is reaching capacity. The host is currently operating at a ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "Template", "description": "Flag indicating whether or not this virtual machine is a template. Apply to the ESX platform only. Returns a boolean true/false response.\n\nStatus Codes:\n0 - TRUE: Virtual Machine is a template.\n1 - FALSE: Virtual Machine is NOT a template.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.template", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "VMState", "description": "Virtual Machine state.\n\nStatus Codes:\n0 - UNKNOWN\n1 - RUNNING\n2 - OFF\n3 - STOPPING\n4 - PAUSED\n5 - STARTING\n6 - SAVING\n7 - RESUMING", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.vm_state", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "7", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Guest OS State", "title": "Guest OS State", "verticalLabel": "status code", "min": -1.0, "max": 3.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "GuestOSState", "datapointName": "GuestOSState", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "State", "color": "fuchsia", "datapointName": "GuestOSState", "isVirtual": false}]}, {"name": "Storage", "title": "VMS Storage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "StorageFree", "datapointName": "StorageFree", "consolidationFn": "average"}, {"name": "StorageProvisioned", "datapointName": "StorageProvisioned", "consolidationFn": "average"}, {"name": "StorageUsed", "datapointName": "StorageUsed", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Free", "color": "navy", "datapointName": "StorageFree", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "StorageProvisioned", "isVirtual": false}, {"type": "stack", "legend": "Used", "color": "aqua", "datapointName": "StorageUsed", "isVirtual": false}]}, {"name": "Storage Utilization", "title": "VMS Storage Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "StorageUtilized", "datapointName": "StorageUtilized", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Storage Utilized", "color": "red", "datapointName": "StorageUtilized", "isVirtual": false}]}, {"name": "Template", "title": "VMS Template Enabled", "verticalLabel": "0=false, 1=true", "min": -1.0, "max": 2.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Template", "datapointName": "Template", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Template Enabled", "color": "lime", "datapointName": "Template", "isVirtual": false}]}, {"name": "VM State", "title": "VM State", "verticalLabel": "status code", "min": -1.0, "max": 8.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "VMState", "datapointName": "VMState", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "State", "color": "orange2", "datapointName": "VMState", "isVirtual": false}]}], "overviewGraphs": [{"name": "Guest OS State", "title": "Top 10 Guest OS States", "verticalLabel": "status code", "min": -1.0, "max": 3.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "GuestOSState", "datapointName": "GuestOSState", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "GuestOSState", "isVirtual": false}]}, {"name": "Storage Utilization", "title": "Top 10 Storage Utilizations", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "StorageUtilized", "datapointName": "StorageUtilized", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "StorageUtilized", "isVirtual": false}]}, {"name": "VM State", "title": "Top 10 VM States", "verticalLabel": "status code", "min": -1.0, "max": 8.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "VMState", "datapointName": "VMState", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "VMState", "isVirtual": false}]}]}

×DataSource: Microsoft_Azure_NetworkInterface (1406)

{"name": "Microsoft_Azure_NetworkInterface", "description": "Monitors Microsoft Azure network interface data and packet transmission metrics.", "appliesTo": "hasCategory(\"Azure/NetworkInterface\")", "searchKeywords": "cloud,interface,microsoft,azure,network", "technicalNotes": "https://docs.microsoft.com/en-us/rest/api/virtualnetwork/networkinterfaces", "displayedAs": "Azure Network Interface", "collectionInterval": "1m", "collectionMethod": "azureinsights", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "BytesReceivedRate", "description": "Number of bytes the Network Interface received.", "interpretMethod": "json", "interpretExpr": "BytesReceivedRate.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesSentRate", "description": "Number of bytes the Network Interface sent.", "interpretMethod": "json", "interpretExpr": "BytesSentRate.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsReceivedRate", "description": "Number of packets the Network Interface received.", "interpretMethod": "json", "interpretExpr": "PacketsReceivedRate.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsSentRate", "description": "Number of packets the Network Interface sent.", "interpretMethod": "json", "interpretExpr": "PacketsSentRate.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Data Throughput", "title": "Data Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "BytesReceivedRate", "datapointName": "BytesReceivedRate", "consolidationFn": "average"}, {"name": "BytesSentRate", "datapointName": "BytesSentRate", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "TotalRate", "expr": "BytesSentRate+BytesReceivedRate"}], "lines": [{"type": "stack", "legend": "Received", "color": "silver", "datapointName": "BytesReceivedRate", "isVirtual": false}, {"type": "stack", "legend": "Sent", "color": "green", "datapointName": "BytesSentRate", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "TotalRate", "isVirtual": true}]}, {"name": "Packet Transmission", "title": "Packet Transmission", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PacketsReceivedRate", "datapointName": "PacketsReceivedRate", "consolidationFn": "average"}, {"name": "PacketsSentRate", "datapointName": "PacketsSentRate", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "TotalRate", "expr": "PacketsSentRate+PacketsReceivedRate"}], "lines": [{"type": "stack", "legend": "Received", "color": "aqua", "datapointName": "PacketsReceivedRate", "isVirtual": false}, {"type": "stack", "legend": "Sent", "color": "olive", "datapointName": "PacketsSentRate", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "gray", "datapointName": "TotalRate", "isVirtual": true}]}]}

×DataSource: AWS_ELB (1652)

{"name": "AWS_ELB", "description": "Collects AWS Elastic Load Balancer performance from Cloudwatch.", "appliesTo": "hasCategory(\"AWS/ELB\")", "searchKeywords": "cloud,amazon,load balancer,elb,aws", "technicalNotes": "- Per Amazon, minimum polling interval is 1m.", "displayedAs": "Load Balancer", "collectionInterval": "2m", "collectionMethod": "awscloudwatch", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "BackendRequests", "description": "Total requests being forwarded to the backend.", "interpretMethod": "expression", "interpretExpr": "Backend_2XXPerSec + Backend_3XXPerSec + Backend_4XXPerSec + Backend_5XXPerSec", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Backend_2XXPerSec", "description": "Rate of successful actions from backend servers", "interpretMethod": "expression", "interpretExpr": "if(un(HTTPCode_Backend_2XX_Raw),0,HTTPCode_Backend_2XX_Raw/##POLLINTERVAL##)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "Backend_2XXPerSecPercentage", "description": "Percentage of actions that are successful from backend servers", "interpretMethod": "expression", "interpretExpr": "(Backend_2XXPerSec/BackendRequests)*100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "Backend_3XXPerSec", "description": "Rate of responses from backends where user agent requires action (e.g. redirection)", "interpretMethod": "expression", "interpretExpr": "if(un(HTTPCode_Backend_3XX_Raw),0,HTTPCode_Backend_3XX_Raw/##POLLINTERVAL##)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "Backend_3XXPerSecPercentage", "description": "Percentage of responses from backends where user agent requires action (e.g. redirection)", "interpretMethod": "expression", "interpretExpr": "(Backend_3XXPerSec/BackendRequests)*100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "Backend_4XXPerSec", "description": "Rate of backend responses indicating client errors. (e.g. page not found)", "interpretMethod": "expression", "interpretExpr": "if(un(HTTPCode_Backend_4XX_Raw),0,HTTPCode_Backend_4XX_Raw/##POLLINTERVAL##)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "The ELB ##HOST## is reporting that backends are returning ##VALUE## 4XX errors per second.\n\nThis condition started at ##START##, or ##DURATION## ago."}, {"name": "Backend_4XXPerSecPercentage", "description": "Percentage of backend responses indicating client errors. (e.g. page not found)", "interpretMethod": "expression", "interpretExpr": "(Backend_4XXPerSec/BackendRequests)*100", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "Backend_5XXPerSec", "description": "Rate of back-end server errors", "interpretMethod": "expression", "interpretExpr": "if(un(HTTPCode_Backend_5XX_Raw),0,HTTPCode_Backend_5XX_Raw/##POLLINTERVAL##)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The ELB ##HOST## is reporting that backends are returning ##VALUE## 5XX errors per second.\n\nThis condition started at ##START##, or ##DURATION## ago."}, {"name": "Backend_5XXPerSecPercentage", "description": "Percentage of back-end server errors", "interpretMethod": "expression", "interpretExpr": "(Backend_5XXPerSec/BackendRequests)*100", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The ELB ##HOST## is reporting that backends are returning ##VALUE## 5XX errors per second.\n\nThis condition started at ##START##, or ##DURATION## ago."}, {"name": "ELB_4XXPerSec", "description": "Rate of client errors (when a request is malformed or is incomplete) from the load balancer (not backends).", "interpretMethod": "expression", "interpretExpr": "if(un(HTTPCode_ELB_4XX_Raw),0,HTTPCode_ELB_4XX_Raw/##POLLINTERVAL##)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "ELB_5XXPerSec", "description": "Rate of HTTP 5XX server error codes generated by the load balancer (not backends).\nReported if there are no back-end instances that are healthy, or if the request rate exceeds the capacity of the instances or the load balancers", "interpretMethod": "expression", "interpretExpr": "if(un(HTTPCode_ELB_5XX_Raw),0,HTTPCode_ELB_5XX_Raw/##POLLINTERVAL##)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "The ELB ##HOST## is returning ##VALUE## 5XX errors per second to clients, as it is unable to keep up with the request rate with the current number of healthy backend servers.\n\nThis condition started at ##START##, or ##DURATION## ago."}, {"name": "HTTPCode_Backend_2XX", "description": "Raw number of successful actions", "interpretMethod": "expression", "interpretExpr": "if(un(HTTPCode_Backend_2XX_Raw),0,HTTPCode_Backend_2XX_Raw)", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HTTPCode_Backend_2XX_Raw", "description": "Raw number of successful actions\n\nThese are raw numbers from CloudWatch. A zero value will return \"No Data\". See \"HTTPCode_Backend_2XX\".", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>HTTPCode_Backend_2XX>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HTTPCode_Backend_3XX", "description": "Raw number of responses from backends where user agent requires action (e.g. redirection)", "interpretMethod": "expression", "interpretExpr": "if(un(HTTPCode_Backend_3XX_Raw),0,HTTPCode_Backend_3XX_Raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HTTPCode_Backend_3XX_Raw", "description": "Raw number of responses from backends where user agent requires action (e.g. redirection)\n\nThese are raw numbers from CloudWatch. A zero value will return \"No Data\". See \"HTTPCode_Backend_3XX\".", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>HTTPCode_Backend_3XX>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HTTPCode_Backend_4XX", "description": "Raw number of backend responses indicating client errors.", "interpretMethod": "expression", "interpretExpr": "if(un(HTTPCode_Backend_4XX_Raw),0,HTTPCode_Backend_4XX_Raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HTTPCode_Backend_4XX_Raw", "description": "Raw number of backend responses indicating client errors.\n\nThese are raw numbers from CloudWatch. A zero value will return \"No Data\". See \"HTTPCode_Backend_4XX\".", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>HTTPCode_Backend_4XX>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HTTPCode_Backend_5XX", "description": "Raw number of back-end server errors", "interpretMethod": "expression", "interpretExpr": "if(un(HTTPCode_Backend_5XX_Raw),0,HTTPCode_Backend_5XX_Raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HTTPCode_Backend_5XX_Raw", "description": "Raw number of back-end server errors\n\nThese are raw numbers from CloudWatch. A zero value will return \"No Data\". See \"HTTPCode_Backend_5XX\".", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>HTTPCode_Backend_5XX>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HTTPCode_ELB_4XX", "description": "Raw number of client errors (when a request is malformed or is incomplete) from the load balancer (not backends).", "interpretMethod": "expression", "interpretExpr": "if(un(HTTPCode_ELB_4XX_Raw),0,HTTPCode_ELB_4XX_Raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HTTPCode_ELB_4XX_Raw", "description": "Raw number of client errors (when a request is malformed or is incomplete) from the load balancer (not backends).\n\nThese are raw numbers from CloudWatch. A zero value will return \"No Data\". See \"HTTPCode_ELB_4XX\".", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>HTTPCode_ELB_4XX>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HTTPCode_ELB_5XX", "description": "Raw number of HTTP 5XX server error codes generated by the load balancer (not backends).\nReported if there are no back-end instances that are healthy, or if the request rate exceeds the capacity of the instances or the load balancers", "interpretMethod": "expression", "interpretExpr": "if(un(HTTPCode_ELB_5XX_Raw),0,HTTPCode_ELB_5XX_Raw)", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HTTPCode_ELB_5XX_Raw", "description": "Raw number of HTTP 5XX server error codes generated by the load balancer (not backends).\nReported if there are no back-end instances that are healthy, or if the request rate exceeds the capacity of the instances or the load balancers\n\nThese are raw numbers from CloudWatch. A zero value will return \"No Data\". See \"HTTPCode_ELB_5XX\".", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>HTTPCode_ELB_5XX>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HealthyHostCount_Raw", "description": "number of healthy instances", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>HealthyHostCount>Average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "HealthyHosts", "description": "The number of healthy hosts reported.\n\nNaN values replaced with 0.", "interpretMethod": "expression", "interpretExpr": "if(un(HealthyHostCount_Raw),0,HealthyHostCount_Raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Latency", "description": "time in seconds after the request leaves the load balancer until the response is received", "interpretMethod": "expression", "interpretExpr": "if(un(Latency_Raw), 0, Latency_Raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Latency_Raw", "description": "time in seconds after the request leaves the load balancer until the response is received\n\nThese are raw numbers from CloudWatch. A zero value will return \"No Data\". See \"Latency\".", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>Latency>Average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "MaxSurgeQueueLength", "description": "Maximum number of requests (across all instances, for the poll interval) that are pending submission to an instance.\n\nNo data is normalized to zero.", "interpretMethod": "expression", "interpretExpr": "if(un(MaxSurgeQueueLength_Raw), 0,MaxSurgeQueueLength_Raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "AWS ELB ##HOST## is reporting the surge queue reached a depth of ##VALUE## requests.\n\nThis indicates it may not be able to keep up with the request rate with the current number of healthy backend servers. Either the request rate has increased; the latency for the backend servers to fill a request has increased; or the number of healthy backend servers has decreased.\n\nThis condition started at ##START##, or ##DURATION## ago."}, {"name": "MaxSurgeQueueLength_Raw", "description": "maximum number of requests (across all instances, for the poll interval) that are pending submission to an instance\n\nThese are raw numbers from CloudWatch. A zero value will return \"No Data\". See \"MaxSurgeQueueLength\".", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>SurgeQueueLength>Max", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0}, {"name": "RequestCount_Raw", "description": "Raw number of completed requests that were received and routed to the back-end instances", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>RequestCount>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "RequestsPerSec", "description": "completed requests that were routed to back-end instances", "interpretMethod": "expression", "interpretExpr": "if(un(RequestCount_Raw),0,RequestCount_Raw/##POLLINTERVAL##)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SpilloverCount", "description": "time in seconds after the request leaves the load balancer until the response is received", "interpretMethod": "expression", "interpretExpr": "if(un(SpilloverCount_Raw),0,SpilloverCount_Raw)", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SpilloverCount_Raw", "description": "requests that were rejected due to the queue being full\n\nThese are raw numbers from CloudWatch. A zero value will return \"No Data\". See \"SpilloverCount\".", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>SpilloverCount>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SpilloverRate", "description": "Rate of requests that were rejected due to the queue being full", "interpretMethod": "expression", "interpretExpr": "if(un(SpilloverCount_Raw), 0,SpilloverCount_Raw/##POLLINTERVAL##)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The ELB ##HOST## is rejecting ##VALUE## requests per second, as it is unable to keep up with the request rate with the current number of healthy backend servers.\n\nThis condition started at ##START##, or ##DURATION## ago."}, {"name": "Status", "description": "number of healthy instances", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>HealthyHostCount>Average", "useValue": "status", "type": "status", "dataType": 2, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "UnHealthyHostCount_Raw", "description": "number of unhealthy instances", "interpretMethod": "none", "interpretExpr": "AWS/ELB>LoadBalancerName:##system.aws.resourceid##>UnHealthyHostCount>Average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 4, "clearInterval": 0, "alertBody": "The ELB ##HOST## now has ##VALUE## backend systems that are not passing health checks. Unless Spillover or ELB_5XX alerts are also occurring, this is a proactive notification, check the state of the backend servers.\n\nThis condition started at ##START##, or ##DURATION## ago."}, {"name": "UnhealthyHosts", "description": "The number of unhealthy hosts reported.\n\nNaN values replaced with 0.", "interpretMethod": "expression", "interpretExpr": "if(un(UnHealthyHostCount_Raw), 0,UnHealthyHostCount_Raw)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "ELB ##HOST## is reporting ##VALUE## unhealthy hosts, placing it into a ##LEVEL## state.\n\nThis condition started at ##START##, or ##DURATION## ago."}], "graphs": [{"name": "Backend Response Codes", "title": "Backend Response Codes", "verticalLabel": "responses/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "Backend_2XXPerSec", "datapointName": "Backend_2XXPerSec", "consolidationFn": "average"}, {"name": "Backend_3XXPerSec", "datapointName": "Backend_3XXPerSec", "consolidationFn": "average"}, {"name": "Backend_4XXPerSec", "datapointName": "Backend_4XXPerSec", "consolidationFn": "average"}, {"name": "Backend_5XXPerSec", "datapointName": "Backend_5XXPerSec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "2XX", "color": "blue", "datapointName": "Backend_2XXPerSec", "isVirtual": false}, {"type": "stack", "legend": "3XX", "color": "purple", "datapointName": "Backend_3XXPerSec", "isVirtual": false}, {"type": "stack", "legend": "4XX", "color": "fuchsia", "datapointName": "Backend_4XXPerSec", "isVirtual": false}, {"type": "stack", "legend": "5XX", "color": "green", "datapointName": "Backend_5XXPerSec", "isVirtual": false}]}, {"name": "Errors", "title": "Errors", "verticalLabel": "errors/second", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "ELB_4XXPerSec", "datapointName": "ELB_4XXPerSec", "consolidationFn": "average"}, {"name": "ELB_5XXPerSec", "datapointName": "ELB_5XXPerSec", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "4XX responses", "color": "blue", "datapointName": "ELB_4XXPerSec", "isVirtual": false}, {"type": "line", "legend": "5XX responses", "color": "red", "datapointName": "ELB_5XXPerSec", "isVirtual": false}]}, {"name": "Hosts", "title": "Backend Hosts", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "HealthyHosts", "datapointName": "HealthyHosts", "consolidationFn": "average"}, {"name": "UnhealthyHosts", "datapointName": "UnhealthyHosts", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "HealthyHosts", "color": "green", "datapointName": "HealthyHosts", "isVirtual": false}, {"type": "stack", "legend": "UnhealthyHosts", "color": "red1", "datapointName": "UnhealthyHosts", "isVirtual": false}]}, {"name": "In Flight Requests", "title": "In Flight Requests", "verticalLabel": "requests", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "Latency", "datapointName": "Latency", "consolidationFn": "average"}, {"name": "RequestsPerSec", "datapointName": "RequestsPerSec", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "InFlight", "expr": "Latency*RequestsPerSec"}], "lines": [{"type": "line", "legend": "InFlight: Requests per sec * Latency", "color": "silver", "datapointName": "InFlight", "isVirtual": true}]}, {"name": "Request Count", "title": "Request Count", "verticalLabel": "requests/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "RequestCount", "datapointName": "RequestsPerSec", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Requests", "color": "black", "datapointName": "RequestCount", "isVirtual": false}]}, {"name": "Request Latency", "title": "Request Latency", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "Latency", "datapointName": "Latency", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Latency", "color": "aqua", "datapointName": "Latency", "isVirtual": false}]}, {"name": "Spillover Requests", "title": "Spillover Requests", "verticalLabel": "requests/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "SpilloverRate", "datapointName": "SpilloverRate", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Spillover Rate", "color": "orange2", "datapointName": "SpilloverRate", "isVirtual": false}]}, {"name": "Surge Queue", "title": "Surge Queue", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "MaxSurgeQueueLength", "datapointName": "MaxSurgeQueueLength", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Queue Length", "color": "red1", "datapointName": "MaxSurgeQueueLength", "isVirtual": false}]}]}

×DataSource: Office365_ExchangeOnline_Groups (2353)

{"name": "Office365_ExchangeOnline_Groups", "description": "Monitors the config group objects. Returns security groups, mail-enabled security groups, distribution groups, and role groups.", "appliesTo": "hasCategory(\"Office365\")", "group": "Office 365 Configs", "searchKeywords": "o365,microsoft,office 365", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/exchange/users-and-groups/get-group?view=exchange-ps", "displayedAs": "Exchange Online: Groups", "collectionInterval": "1d", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\n\n#Retrieve Exchange Online credentials from OFFICE365 properties\n$username = @'\n##OFFICE365.USER##\n'@\n$password = @'\n##OFFICE365.PASS##\n'@ | ConvertTo-SecureString -asPlainText -Force\n\n#Build credential object for passthrough and create new remote PS session\n$credential = New-Object System.Management.Automation.PSCredential($username, $password)\n$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credential -Authentication Basic -AllowRedirection\n\n#Import Exchange Online Powershell Commands to local session\nImport-PSSession $session -AllowClobber -DisableNameChecking | Out-Null\n\n# Group info.\nGet-Group | Select-Object Name, GroupType, Description, OrganizationalUnit | Sort-Object Name\n\n# Close all PS Sessions to not hit 3 concurrent rate limit.\nGet-PSSession | Remove-PSSession\n\nExit"}, "configChecks": [{"name": "anyChange", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}, {"name": "cantRetrieve", "description": "", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Office365_ExchangeOnline_Mailboxes (2354)

{"name": "Office365_ExchangeOnline_Mailboxes", "description": "Monitors the Exchange mailbox configs.", "appliesTo": "hasCategory(\"Office365\")", "group": "Office 365 Configs", "searchKeywords": "o365,microsoft,office 365", "technicalNotes": "https://technet.microsoft.com/en-us/library/aa997571(v=exchg.160).aspx", "displayedAs": "Exchange Online: Mailboxes", "collectionInterval": "1d", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\n\n#Retrieve Exchange Online credentials from OFFICE365 properties\n$username = @'\n##OFFICE365.USER##\n'@\n$password = @'\n##OFFICE365.PASS##\n'@ | ConvertTo-SecureString -asPlainText -Force\n\n#Build credential object for passthrough and create new remote PS session\n$credential = New-Object System.Management.Automation.PSCredential($username, $password)\n$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credential -Authentication Basic -AllowRedirection\n\n#Import Exchange Online Powershell Commands to local session\nImport-PSSession $session -AllowClobber -DisableNameChecking | Out-Null\n\n# Discover the Exchange Mailboxes\nGet-CASMailbox | Sort-Object Name\n\n# Close all PS Sessions to not hit 3 concurrent rate limit.\nGet-PSSession | Remove-PSSession\n\nExit"}, "configChecks": [{"name": "cantRetrieve", "description": "", "type": "fetch", "severity": "warn"}, {"name": "changeDetection", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Office365_ExchangeOnline_ManagementRoles (2355)

{"name": "Office365_ExchangeOnline_ManagementRoles", "description": "Monitors the Exchange management role objects in your organization", "appliesTo": "hasCategory(\"Office365\")", "group": "Office 365 Configs", "searchKeywords": "o365,microsoft,office 365", "displayedAs": "Exchange Online: Management Roles", "collectionInterval": "1d", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\n\n#Retrieve Exchange Online credentials from OFFICE365 properties\n$username = @'\n##OFFICE365.USER##\n'@\n$password = @'\n##OFFICE365.PASS##\n'@ | ConvertTo-SecureString -asPlainText -Force\n\n#Build credential object for passthrough and create new remote PS session\n$credential = New-Object System.Management.Automation.PSCredential($username, $password)\n$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credential -Authentication Basic -AllowRedirection\n\n#Import Exchange Online Powershell Commands to local session\nImport-PSSession $session -AllowClobber -DisableNameChecking | Out-Null\n\n# Get managemetn roles\nGet-ManagementRoleAssignment -Enabled $true -Delegating $true | Select-Object Role, RoleAssigneeName, Enabled, RoleAssignmentDelegationType | Sort-Object Name, Role | ft\n\n# Close all PS Sessions to not hit 3 concurrent rate limit.\nGet-PSSession | Remove-PSSession\n\nExit"}, "configChecks": [{"name": "cantRetrieve", "description": "", "type": "fetch", "severity": "warn"}, {"name": "changeDetection", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Office365_ExchangeOnline_MobileDeviceMailboxPolicy (2356)

{"name": "Office365_ExchangeOnline_MobileDeviceMailboxPolicy", "description": "Monitors Exchange mobile device mailbox policy config.", "appliesTo": "hasCategory(\"Office365\")", "group": "Office 365 Configs", "searchKeywords": "o365,microsoft,office 365", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/exchange/devices/get-mobiledevicemailboxpolicy?view=exchange-ps", "displayedAs": "Exchange Online: Mobile Device Mailbox Policy", "collectionInterval": "1d", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\n\n#Retrieve Exchange Online credentials from OFFICE365 properties\n$username = @'\n##OFFICE365.USER##\n'@\n$password = @'\n##OFFICE365.PASS##\n'@ | ConvertTo-SecureString -asPlainText -Force\n\n#Build credential object for passthrough and create new remote PS session\n$credential = New-Object System.Management.Automation.PSCredential($username, $password)\n$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credential -Authentication Basic -AllowRedirection\n\n#Import Exchange Online Powershell Commands to local session\nImport-PSSession $session -AllowClobber -DisableNameChecking | Out-Null\n\n# Get mobile device mailbox policies.\nGet-MobileDeviceMailboxPolicy | Select-Object * -excludeproperty RunspaceID, WhenChanged, WhenChangedUTC, OriginatingServer\n\n# Close all PS Sessions to not hit 3 concurrent rate limit.\nGet-PSSession | Remove-PSSession\n\nExit"}, "configChecks": [{"name": "anyChange", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": ["WhenChanged:"], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}, {"name": "cantRetrieve", "description": "", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Office365_ExchangeOnline_MobileDevices (2357)

{"name": "Office365_ExchangeOnline_MobileDevices", "description": "Monitors Exchange mobile device config for identification, configuration, and status information for each mobile device.", "appliesTo": "hasCategory(\"Office365\")", "group": "Office 365 Configs", "searchKeywords": "o365,microsoft,office 365", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/exchange/devices/get-mobiledevice?view=exchange-ps", "displayedAs": "Exchange Online: Mobile Devices", "collectionInterval": "1d", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\n\n#Retrieve Exchange Online credentials from OFFICE365 properties\n$username = @'\n##OFFICE365.USER##\n'@\n$password = @'\n##OFFICE365.PASS##\n'@ | ConvertTo-SecureString -asPlainText -Force\n\n#Build credential object for passthrough and create new remote PS session\n$credential = New-Object System.Management.Automation.PSCredential($username, $password)\n$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credential -Authentication Basic -AllowRedirection\n\n#Import Exchange Online Powershell Commands to local session\nImport-PSSession $session -AllowClobber -DisableNameChecking | Out-Null\n\n# Get mobile devices\nGet-MobileDevice -ResultSize unlimited | Format-Table -Auto Identity, UserDisplayName, DeviceModel, DeviceOS, DeviceAccessState\n\n# Close all PS Sessions to not hit 3 concurrent rate limit.\nGet-PSSession | Remove-PSSession\n\nExit"}, "configChecks": [{"name": "cantRetrieve", "description": "", "type": "fetch", "severity": "warn"}, {"name": "changeDetection", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Office365_ExchangeOnline_OWAMailboxPolicy (2358)

{"name": "Office365_ExchangeOnline_OWAMailboxPolicy", "description": "Monitors Exchange Outlook on the web mailbox policies in the organization.", "appliesTo": "hasCategory(\"Office365\")", "group": "Office 365 Configs", "searchKeywords": "o365,microsoft,office 365", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/exchange/client-access/get-owamailboxpolicy?view=exchange-ps", "displayedAs": "Exchange Online: OWA Mailbox Policy", "collectionInterval": "1d", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\n\n#Retrieve Exchange Online credentials from OFFICE365 properties\n$username = @'\n##OFFICE365.USER##\n'@ \n$password = @'\n##OFFICE365.PASS##\n'@ | ConvertTo-SecureString -asPlainText -Force\n\n#Build credential object for passthrough and create new remote PS session\n$credential = New-Object System.Management.Automation.PSCredential($username, $password)\n$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credential -Authentication Basic -AllowRedirection\n\n#Import Exchange Online Powershell Commands to local session\nImport-PSSession $session -AllowClobber -DisableNameChecking | Out-Null\n\n# Get OWA mailbox policies\nGet-OWAMailboxPolicy | Select-Object * -excludeproperty RunspaceID, WhenChanged, WhenChangedUTC\n\n# Close all PS Sessions to not hit 3 concurrent rate limit.\nGet-PSSession | Remove-PSSession\n\nExit"}, "configChecks": [{"name": "cantRetrieve", "description": "", "type": "fetch", "severity": "warn"}, {"name": "changeDetection", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Office365_ExchangeOnline_Organization (2359)

{"name": "Office365_ExchangeOnline_Organization", "description": "Monitors Exchange organization config.", "appliesTo": "hasCategory(\"Office365\")", "group": "Office 365 Configs", "searchKeywords": "o365,microsoft,office 365", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/exchange/organization/get-organizationconfig?view=exchange-ps", "displayedAs": "Exchange Online: Organization", "collectionInterval": "1d", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\n\n#Retrieve Exchange Online credentials from OFFICE365 properties\n$username = @'\n##OFFICE365.USER##\n'@ \n$password = @'\n##OFFICE365.PASS##\n'@ | ConvertTo-SecureString -asPlainText -Force\n\n#Build credential object for passthrough and create new remote PS session\n$credential = New-Object System.Management.Automation.PSCredential($username, $password)\n$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credential -Authentication Basic -AllowRedirection\n\n#Import Exchange Online Powershell Commands to local session\nImport-PSSession $session -CommandName Get-OrganizationConfig -AllowClobber -DisableNameChecking | Out-Null\n\n# Get organization configuration\nGet-OrganizationConfig | Select-Object * -excludeproperty OriginatingServer, RunspaceID, WhenChanged, WhenChangedUTC, GroupLifeCyclePolicy, OrganizationConfigHash, LegacyExchangeDN\n\n# Close all PS Sessions to not hit 3 concurrent rate limit.\nGet-PSSession | Remove-PSSession\n\nExit"}, "configChecks": [{"name": "anyChange", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": ["WhenChanged:", "WhenChanged|WhenChangedUTC"], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}, {"name": "cantRetrieve", "description": "", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Office365_ExchangeOnline_TransportConfig (2360)

{"name": "Office365_ExchangeOnline_TransportConfig", "description": "Monitors Exchange organization-wide transport configuration settings.", "appliesTo": "hasCategory(\"Office365\")", "group": "Office 365 Configs", "searchKeywords": "o365,microsoft,office 365", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/exchange/mail-flow/get-transportconfig?view=exchange-ps", "displayedAs": "Exchange Online: Transport Config", "collectionInterval": "1d", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\n\n#Retrieve Exchange Online credentials from OFFICE365 properties\n$username = @'\n##OFFICE365.USER##\n'@\n$password = @'\n##OFFICE365.PASS##\n'@ | ConvertTo-SecureString -asPlainText -Force\n\n#Build credential object for passthrough and create new remote PS session\n$credential = New-Object System.Management.Automation.PSCredential($username, $password)\n$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credential -Authentication Basic -AllowRedirection\n\n#Import Exchange Online Powershell Commands to local session\nImport-PSSession $session -AllowClobber -DisableNameChecking | Out-Null\n\n# Get transport config\nGet-TransportConfig\n\n# Close all PS Sessions to not hit 3 concurrent rate limit.\nGet-PSSession | Remove-PSSession\n\nExit"}, "configChecks": [{"name": "cantRetrieve", "description": "", "type": "fetch", "severity": "warn"}, {"name": "changeDetection", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Microsoft_Azure_StandardLoadBalancers (1266)

{"name": "Microsoft_Azure_StandardLoadBalancers", "description": "Gathers Azure Standard Load Balancer metrics from Azure Monitor.", "appliesTo": "hasCategory(\"Azure/LoadBalancers\") and system.azure.sku == \"Standard\"", "searchKeywords": "cloud,standard load balancer,load balancer,azure", "displayedAs": "Microsoft Azure Load Balancer", "collectionInterval": "5m", "collectionMethod": "azureinsights", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "SNATAllocatedPorts", "description": "Total number of SNAT ports allocated to all backend instances within the polling interval.", "interpretMethod": "json", "interpretExpr": "AllocatedSnatPorts.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SNATConnectionCount", "description": "Total number of new SNAT connections created during the polling interval.", "interpretMethod": "json", "interpretExpr": "SnatConnectionCount.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SNATUsedPorts", "description": "Total number of SNAT ports utilized during the polling interval.", "interpretMethod": "json", "interpretExpr": "UsedSnatPorts.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SNATUsedPortsPercentage", "description": "Percentage of SNAT ports in use.", "interpretMethod": "expression", "interpretExpr": "(SNATUsedPorts/SNATAllocatedPorts)*100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": ">= 90", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Azure Load Balancer ##HOST## is reporting a SNAT port usage of ##VALUE##%, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "SYNCount", "description": "Total number of SYN Packets transmitted during the polling interval.\n\nStandard Load Balancer does not terminate Transmission Control Protocol (TCP) connections or interact with TCP or UDP packet flows. Flows and their handshakes are always between the source and the VM instance. To better troubleshoot your TCP protocol scenarios, you can make use of SYN packets counters to understand how many TCP connection attempts are made. The metric reports the number of TCP SYN packets that were received.", "interpretMethod": "json", "interpretExpr": "SYNCount.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "byteTransmissionRate", "description": "Transmission rate within the polling interval. Measured in bytes/sec.", "interpretMethod": "json", "interpretExpr": "ByteCount.##primaryaggregation##", "useValue": "rawData", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dataPathAvailability", "description": "Average percentage of time the Load Balancer data path was available (VIP availability) during the polling interval.\n\nStandard Load Balancer continuously exercises the data path from within a region to the load balancer front end, all the way to the SDN stack that supports your VM. As long as healthy instances remain, the measurement follows the same path as your application's load-balanced traffic. The data path that your customers use is also validated. The measurement is invisible to your application and does not interfere with other operations.", "interpretMethod": "json", "interpretExpr": "VipAvailability.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "< 100 75", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Azure Load Balancer ##HOST## is reporting data path availability of ##VALUE##%, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "healthProbeStatus", "description": "Average percentage of time the Load Balancer health probing succeeded during the polling interval. \n\nStandard Load Balancer uses a distributed health-probing service that monitors your application endpoint's health according to your configuration settings. This metric provides an aggregate view of each instance endpoint in the load balancer pool. You can see how Load Balancer views the health of your application, as indicated by your health probe configuration.", "interpretMethod": "json", "interpretExpr": "DipAvailability.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "< 100 50", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Azure Load Balancer ##HOST## is reporting health probe failures, currently ##VALUE##% of health probes are succeeding, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "packetTransmissionRate", "description": "Number of Packets transmitted during the polling interval. Measured in packets/second.", "interpretMethod": "json", "interpretExpr": "PacketCount.##primaryaggregation##", "useValue": "rawData", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Data Path Availability", "title": "Data Path Availability", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "dataPathAvailability", "datapointName": "dataPathAvailability", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Availability", "color": "teal", "datapointName": "dataPathAvailability", "isVirtual": false}]}, {"name": "Health Probe Success Rate", "title": "Health Probe Success Rate", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "healthProbeStatus", "datapointName": "healthProbeStatus", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Success Rate", "color": "fuchsia", "datapointName": "healthProbeStatus", "isVirtual": false}]}, {"name": "Packet Rate", "title": "Packet Rate", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "packetTransmissionRate", "datapointName": "packetTransmissionRate", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Rate", "color": "blue", "datapointName": "packetTransmissionRate", "isVirtual": false}]}, {"name": "SNAT Connections", "title": "SNAT Connections", "verticalLabel": "count", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SNATConnectionCount", "datapointName": "SNATConnectionCount", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Connections", "color": "purple", "datapointName": "SNATConnectionCount", "isVirtual": false}]}, {"name": "SNAT Ports", "title": "SNAT Ports", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SNATAllocatedPorts", "datapointName": "SNATAllocatedPorts", "consolidationFn": "average"}, {"name": "SNATUsedPorts", "datapointName": "SNATUsedPorts", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Allocated", "color": "black", "datapointName": "SNATAllocatedPorts", "isVirtual": false}, {"type": "area", "legend": "Used", "color": "navy", "datapointName": "SNATUsedPorts", "isVirtual": false}]}, {"name": "SYN Packets", "title": "SYN Packets", "verticalLabel": "count", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SYNCount", "datapointName": "SYNCount", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Count", "color": "orange2", "datapointName": "SYNCount", "isVirtual": false}]}, {"name": "Transmission Rate", "title": "Transmission Rate", "verticalLabel": "bps", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "byteTransmissionRate", "datapointName": "byteTransmissionRate", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "byteTransmissionRateBps", "expr": "byteTransmissionRate*8"}], "lines": [{"type": "line", "legend": "Rate", "color": "green", "datapointName": "byteTransmissionRateBps", "isVirtual": true}]}]}

×DataSource: Microsoft_Azure_ReplicationJobs (611)

{"name": "Microsoft_Azure_ReplicationJobs", "description": "Gathers Azure Replication Job metrics from the Azure Replication Jobs API.", "appliesTo": "hasCategory(\"Azure/RecoveryServices\")", "searchKeywords": "cloud,replication,backup and replication,azure", "technicalNotes": "Module uses the List and Get for Active Discovery and Collection respectively. https://docs.microsoft.com/en-us/rest/api/site-recovery/replication-jobs", "displayedAs": "Replication Jobs", "collectionInterval": "30m", "collectionMethod": "azurereplicationjob", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_azurereplicationjob", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "groupMethod": "ilp", "groupExpr": "auto.properties.entityfriendlyname"}, "datapoints": [{"name": "errorCount", "description": "The number of errors that occurred during job execution.", "interpretMethod": "none", "interpretExpr": "errorCount", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "Errors During Azure Replication Job ##INSTANCE##", "alertBody": "The Azure Replication job ##INSTANCE## associated with ##HOST## experienced ##VALUE## errors during execution, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "state", "description": "The status of the job. Status codes:\n\n1=Not Started\n2=In Progress\n3=Succeeded\n4=Suspended\n5=Cancelled\n6=Other\n7=Failed", "interpretMethod": "none", "interpretExpr": "state", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "1", "max": "7", "threshold": "= 7 7", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "Failed Azure Replication Job ##INSTANCE##", "alertBody": "The Azure Replication job ##INSTANCE## associated with ##HOST## has failed (status code: ##VALUE##), placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "timeSinceStart", "description": "The time elapsed since the job was started. Measured in seconds.\n\nIf the job has finished returns the time the job took to complete.", "interpretMethod": "none", "interpretExpr": "timeSinceStart", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Error Count", "title": "Error Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "errorCount", "datapointName": "errorCount", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Errors", "color": "red", "datapointName": "errorCount", "isVirtual": false}]}, {"name": "Job Status", "title": "Job Status", "verticalLabel": "status code", "min": 0.0, "max": 8.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "state", "datapointName": "state", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Status", "color": "teal", "datapointName": "state", "isVirtual": false}]}, {"name": "Time Elapsed", "title": "Time Elapsed", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "timeSinceStart", "datapointName": "timeSinceStart", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Time Since Job Start", "color": "fuchsia", "datapointName": "timeSinceStart", "isVirtual": false}]}], "overviewGraphs": [{"name": "Longest Running Jobs", "title": "Longest Running Jobs", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "timeSinceStart", "datapointName": "timeSinceStart", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "timeSinceStart", "isVirtual": false}]}, {"name": "Top Jobs by Error Count", "title": "Top Jobs by Error Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "errorCount", "datapointName": "errorCount", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "errorCount", "isVirtual": false}]}, {"name": "Top Jobs by Status", "title": "Top Jobs by Status", "verticalLabel": "status code", "min": 0.0, "max": 8.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "state", "datapointName": "state", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "state", "isVirtual": false}]}]}

×DataSource: AWS_Connect (1169)

{"name": "AWS_Connect", "description": "Gathers AWS Connect instance metrics as reported by CloudWatch.", "appliesTo": "hasCategory(\"AWS/LMAccount\")", "searchKeywords": "cloud,amazon,aws,ccas,connect", "technicalNotes": "- Connect instances need to manually be added, the instance ID should be the wildcard value.\n- https://docs.aws.amazon.com/connect/latest/adminguide/monitoring-cloudwatch.html", "displayedAs": "AWS Connect", "collectionInterval": "5m", "collectionMethod": "awscloudwatch", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": false, "discoveryMethod": "", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "groupMethod": "none"}, "datapoints": [{"name": "callRecordingUploadErrors", "description": "The number of call recordings that failed to upload to the Amazon S3 bucket configured for your instance. This is the bucket specified in Data Storage > Call Recordings settings for the instance.", "interpretMethod": "none", "interpretExpr": "AWS/Connect>InstanceId:##wildvalue##>MetricGroup:CallRecordings>CallRecordingUploadError>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 2, "alertBody": "AWS Connect instance ##INSTANCE## on AWS account ##HOST## is experiencing call recording upload failures, ##VALUE## failures occurred during the last polling interval placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "callRecordingUploadErrorsNormalized", "description": "The number of call recordings that failed to upload to the Amazon S3 bucket configured for your instance. This is the bucket specified in Data Storage > Call Recordings settings for the instance.", "interpretMethod": "expression", "interpretExpr": "if(un(status),unkn() ,if(un(callRecordingUploadErrors), 0, callRecordingUploadErrors))", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "callsBreachingConcurrencyQuota", "description": "The total number of voice calls that exceeded the concurrent calls quota for the instance during the polling interval.", "interpretMethod": "none", "interpretExpr": "AWS/Connect>InstanceId:##wildvalue##>CallsBreachingConcurrencyQuota>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "callsBreachingConcurrencyQuotaNormalized", "description": "The total number of voice calls that exceeded the concurrent calls quota for the instance during the polling interval.", "interpretMethod": "expression", "interpretExpr": "if(un(status),unkn() ,if(un(callsBreachingConcurrencyQuota), 0, callsBreachingConcurrencyQuota))", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "callsPerInterval", "description": "The number of voice calls, both inbound and outbound, received or placed per second in the instance during the polling interval. Measured in calls/sec.", "interpretMethod": "none", "interpretExpr": "AWS/Connect>InstanceId:##wildvalue##>MetricGroup:VoiceCalls>CallsPerInterval>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "callsPerIntervalNormalized", "description": "The number of voice calls, both inbound and outbound, received or placed per second in the instance during the polling interval. Measured in calls/sec.", "interpretMethod": "expression", "interpretExpr": "if(un(status),unkn() ,if(un(callsPerInterval), 0, callsPerInterval))", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "concurrentCalls", "description": "The average number of concurrent active voice calls in the instance during the polling interval. All active voice calls are included, not only active calls that are connected to agents.", "interpretMethod": "none", "interpretExpr": "AWS/Connect>InstanceId:##wildvalue##>MetricGroup:VoiceCalls>ConcurrentCalls>Max", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "concurrentCallsNormalized", "description": "The average number of concurrent active voice calls in the instance during the polling interval. All active voice calls are included, not only active calls that are connected to agents.", "interpretMethod": "expression", "interpretExpr": "if(un(status),unkn() ,if(un(concurrentCalls), 0, concurrentCalls))", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "concurrentCallsPercentage", "description": "The percentage of the concurrent active voice calls service quota used in the instance. This is calculated using:\n\nConcurrentCalls/ConfiguredConcurrentCallsLimit * 100.", "interpretMethod": "none", "interpretExpr": "AWS/Connect>InstanceId:##wildvalue##>MetricGroup:VoiceCalls>ConcurrentCallsPercentage>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "> 80 90 98", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 2, "alertBody": "AWS Connect instance ##INSTANCE## on AWS account ##HOST## is experiencing high concurrent call volume, quota usage was ##VALUE##% during the last polling interval placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "concurrentCallsPercentageNormalized", "description": "The percentage of the concurrent active voice calls service quota used in the instance. This is calculated using:\n\nConcurrentCalls/ConfiguredConcurrentCallsLimit * 100.", "interpretMethod": "expression", "interpretExpr": "if(un(status),unkn() ,if(un(concurrentCallsPercentage), 0, concurrentCallsPercentage))", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "misconfiguredPhoneNumbers", "description": "The number of calls that failed because the phone number is not associated with a contact flow.", "interpretMethod": "none", "interpretExpr": "AWS/Connect>InstanceId:##wildvalue##>MetricGroup:VoiceCalls>MisconfiguredPhoneNumbers>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "AWS Connect instance ##INSTANCE## on AWS account ##HOST## is experiencing sustained rate of misconfigured phone number failures, ##VALUE## failures occurred during the last polling interval placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "misconfiguredPhoneNumbersNormalized", "description": "The number of calls that failed because the phone number is not associated with a contact flow.", "interpretMethod": "expression", "interpretExpr": "if(un(status),unkn() ,if(un(misconfiguredPhoneNumbers), 0, misconfiguredPhoneNumbers))", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "missedCalls", "description": "The number of voice calls that were missed by agents during the polling interval. \n\nA missed call is one that is not answered by an agent within 20 seconds.", "interpretMethod": "none", "interpretExpr": "AWS/Connect>InstanceId:##wildvalue##>MetricGroup:VoiceCalls>MissedCalls>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "AWS Connect instance ##INSTANCE## on AWS account ##HOST## is experiencing sustained rate of missed calls, ##VALUE## missed calls occurred during the last polling interval placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "missedCallsNormalized", "description": "The number of voice calls that were missed by agents during the polling interval. \n\nA missed call is one that is not answered by an agent within 20 seconds.", "interpretMethod": "expression", "interpretExpr": "if(un(status),unkn() ,if(un(missedCalls), 0, missedCalls))", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "status", "description": "CloudWatch Response Status", "interpretMethod": "none", "interpretExpr": "AWS/Connect>InstanceId:##wildvalue##>MetricGroup:VoiceCalls>CallsPerInterval>Sum", "useValue": "status", "type": "status", "dataType": 2, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "throttledCalls", "description": "The number of voice calls that were rejected during the polling interval because the rate of calls per second exceeded the maximum supported quota. \n\nTo increase the supported rate of calls, request an increase in the service quota for concurrent active calls per instance.", "interpretMethod": "none", "interpretExpr": "AWS/Connect>InstanceId:##wildvalue##>MetricGroup:VoiceCalls>ThrottledCalls>Sum", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "throttledCallsNormalized", "description": "The number of voice calls that were rejected during the polling interval because the rate of calls per second exceeded the maximum supported quota. \n\nTo increase the supported rate of calls, request an increase in the service quota for concurrent active calls per instance.", "interpretMethod": "expression", "interpretExpr": "if(un(status),unkn() ,if(un(throttledCalls), 0, throttledCalls))", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "toInstancePacketLossRate", "description": "The ratio of packet loss for calls in the instance. Each data point is between 0 and 1, which represents the ratio of packets lost for the instance.", "interpretMethod": "none", "interpretExpr": "AWS/Connect>InstanceId:##wildvalue##>Participant:Agent>Type of Connection:WebRTC>Stream Type:Voice>ToInstancePacketLossRate>Max", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "toInstancePacketLossRateNormalized", "description": "The ratio of packet loss for calls in the instance. Each data point is between 0 and 1, which represents the ratio of packets lost for the instance.", "interpretMethod": "expression", "interpretExpr": "if(un(toInstancePacketLossRate), 0, toInstancePacketLossRate)", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": ">= 0.1 0.5 0.9", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "AWS Connect instance ##INSTANCE## on AWS account ##HOST## is experiencing high call packet loss ##VALUE##, during the last polling interval placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Call Packet Loss", "title": "Call Packet Loss", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PacketLossRaw", "datapointName": "toInstancePacketLossRateNormalized", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "PacketLoss", "expr": "PacketLossRaw*100"}], "lines": [{"type": "area", "legend": "Packet Loss", "color": "red", "datapointName": "PacketLoss", "isVirtual": true}]}, {"name": "Call Rate", "title": "Call Rate", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "concurrentCalls", "datapointName": "callsPerIntervalNormalized", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Calls", "color": "green", "datapointName": "concurrentCalls", "isVirtual": false}]}, {"name": "Concurrent Calls", "title": "Concurrent Calls", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Calls", "datapointName": "concurrentCallsNormalized", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Calls", "color": "teal", "datapointName": "Calls", "isVirtual": false}]}, {"name": "Concurrent Calls Quota Usage", "title": "Concurrent Calls Quota Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "concurrentCallsPercentageNormalized", "datapointName": "concurrentCallsPercentageNormalized", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Quota Usage", "color": "fuchsia", "datapointName": "concurrentCallsPercentageNormalized", "isVirtual": false}]}, {"name": "Failed Call Recording Uploads", "title": "Failed Call Recording Uploads", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "callRecordingUploadErrorsNormalized", "datapointName": "callRecordingUploadErrorsNormalized", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Uploads", "color": "orange2", "datapointName": "callRecordingUploadErrorsNormalized", "isVirtual": false}]}, {"name": "Failed Calls", "title": "Failed Calls", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "callsBreachingConcurrencyQuotaNormalized", "datapointName": "callsBreachingConcurrencyQuotaNormalized", "consolidationFn": "average"}, {"name": "misconfiguredPhoneNumbersNormalized", "datapointName": "misconfiguredPhoneNumbersNormalized", "consolidationFn": "average"}, {"name": "missedCallsNormalized", "datapointName": "missedCallsNormalized", "consolidationFn": "average"}, {"name": "throttledCallsNormalized", "datapointName": "throttledCallsNormalized", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Breaching Concurrency Quota", "color": "purple", "datapointName": "callsBreachingConcurrencyQuotaNormalized", "isVirtual": false}, {"type": "stack", "legend": "Misconfigured Phone Number", "color": "orange2", "datapointName": "misconfiguredPhoneNumbersNormalized", "isVirtual": false}, {"type": "stack", "legend": "Missed", "color": "red", "datapointName": "missedCallsNormalized", "isVirtual": false}, {"type": "stack", "legend": "Throttled", "color": "gray", "datapointName": "throttledCallsNormalized", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top Instances by Misconfigured Phone Number", "title": "Top Instances by Misconfigured Phone Number", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "misconfiguredPhoneNumbersNormalized", "datapointName": "misconfiguredPhoneNumbersNormalized", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "misconfiguredPhoneNumbersNormalized", "isVirtual": false}]}, {"name": "Top Instances by Missed Calls", "title": "Top Instances by Missed Calls", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "missedCallsNormalized", "datapointName": "missedCallsNormalized", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "missedCallsNormalized", "isVirtual": false}]}, {"name": "Top Instances by Packet Loss", "title": "Top Instances by Packet Loss", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 6, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "PacketLossRaw", "datapointName": "toInstancePacketLossRateNormalized", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "PacketLoss", "expr": "PacketLossRaw * 100"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "PacketLoss", "isVirtual": true}]}, {"name": "Top Instances by Quota Usage", "title": "Top Instances by Quota Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "concurrentCallsPercentageNormalized", "datapointName": "concurrentCallsPercentageNormalized", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "concurrentCallsPercentageNormalized", "isVirtual": false}]}, {"name": "Top Instances by Recording Upload Errors", "title": "Top Instances by Recording Upload Errors", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "callRecordingUploadErrorsNormalized", "datapointName": "callRecordingUploadErrorsNormalized", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "callRecordingUploadErrorsNormalized", "isVirtual": false}]}, {"name": "Top Instances by Throttled Calls", "title": "Top Instances by Throttled Calls", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "throttledCallsNormalized", "datapointName": "throttledCallsNormalized", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "throttledCallsNormalized", "isVirtual": false}]}]}

×DataSource: Microsoft_Azure_SQLDatabaseNonDTU (1152)

{"name": "Microsoft_Azure_SQLDatabaseNonDTU", "description": "Monitors the Azure SQL database connections for databases that use vCore-based pricing, deadlocks, CPU and Storage utilization.", "appliesTo": "hasCategory(\"Azure/SQLDatabase\") && \n!(azure.requestedServiceObjectiveName == \"Basic\" ||\n azure.requestedServiceObjectiveName == \"S0\" ||\n azure.requestedServiceObjectiveName == \"P1\")", "searchKeywords": "cloud,database,mssql,azure,sql", "technicalNotes": "- Service Tier Information : https://docs.microsoft.com/en-us/azure/sql-database/sql-database-service-tiers-vcore", "displayedAs": "Azure SQL Database (vCore)", "collectionInterval": "1m", "collectionMethod": "azureinsights", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "BlockedByFireWall", "description": "The number of connections, per second, that were blocked by the firewall.", "interpretMethod": "json", "interpretExpr": "blocked_by_firewall.##primaryaggregation##", "useValue": "rawData", "type": "derive", "dataType": 7, "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Azure SQL Database ##HOST## is reporting ##VALUE## connections/sec that are being blocked by the firewall, placing the database into ##LEVEL## state.\n\nIf the firewall is blocking a high number of connections, it may be that server-level firewall rules have not been specified to allowing certain IP addresses to access the Azure SQL Database.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "CPUPercent", "description": "Average CPU utilization as a percentage of the limit of the service tier.", "interpretMethod": "json", "interpretExpr": "cpu_percent.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "threshold": "> 85 95", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "The Azure SQL Database ##HOST## is experiencing high CPU utilization exceeding ##VALUE## % , placing it into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "ConnectionFailed", "description": "The number of failed connections, per second.", "interpretMethod": "json", "interpretExpr": "connection_failed.##primaryaggregation##", "useValue": "rawData", "type": "derive", "dataType": 7, "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Azure SQL Database ##HOST## is reporting ##VALUE## failed connections/sec, placing the database into ##LEVEL## state.\n\nA high number of connection failures may be the result of the IP address of the request is not within the ranges specified in any of the server-level or database-level firewall rules.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "ConnectionSuccessful", "description": "The number of successful connections, per second, to the SQL server.", "interpretMethod": "json", "interpretExpr": "connection_successful.##primaryaggregation##", "useValue": "rawData", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Deadlocks", "description": "Number of deadlocks per second.", "interpretMethod": "json", "interpretExpr": "deadlock.##primaryaggregation##", "useValue": "rawData", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "LogWritePercent", "description": "Average log IO write utilization as a percentage of the limit of the service tier.", "interpretMethod": "json", "interpretExpr": "log_write_percent.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PhysicalDataReadPercent", "description": "Average IO read utilization as a percentage of the limit of the service tier.", "interpretMethod": "json", "interpretExpr": "physical_data_read_percent.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SessionsPercent", "description": "Currently used percentage of allowed concurrent sessions, limited by the service tier.", "interpretMethod": "json", "interpretExpr": "sessions_percent.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "threshold": "> 85 95", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Azure SQL Database ##HOST## has reported ##VALUE## % utilization of its available sessions, placing the database into ##LEVEL## state.\n\nIf this percentage is consistently near 100, you may want to considering upgrading to a higher service tier.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "Storage", "description": "Total database size, in bytes.", "interpretMethod": "json", "interpretExpr": "storage.average", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "StoragePercent", "description": "Percent of the available storage utilized.", "interpretMethod": "json", "interpretExpr": "storage_percent.average", "useValue": "rawData", "type": "gauge", "dataType": 7, "max": "100", "threshold": "> 85 95", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Azure SQL Database ##HOST## has reported ##VALUE## % utilization of its available storage space, placing the database into ##LEVEL## state.\n\nIf this percentage is consistently near maximum, you may want to considering upgrading to a higher service tier.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "WorkersPercent", "description": "Percent of concurrent workers (requests) based on the limit of the database\u2019s service tier.", "interpretMethod": "json", "interpretExpr": "workers_percent.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "threshold": "> 95", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Azure SQL Database ##HOST## has reported ##VALUE## % utilization of it's maximum number of concurrent workers (requests), placing the database into ##LEVEL## state.\n\nIf this percentage is consistently near maximum, you may want to considering upgrading to a higher service tier.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "XTPStoragePercent", "description": "Percent utilization for In-Memory OLTP (Online Transactional Processing) of the limit of the service tier.\n\n*Note : In-Memory storage is only found on Premium Service Tiers.", "interpretMethod": "json", "interpretExpr": "xtp_storage_percent.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "max": "100", "threshold": ">= 90 95", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "Azure SQL Database ##HOST## is experiencing high In-Memory OLTP utilization of ##VALUE## %, placing the database into ##LEVEL## state.\n\nRunning out-of-memory results in INSERT, UPDATE, and CREATE operations failing with error message 41823.\n\nTo resolve this error, either:\n- Delete data from the memory-optimized tables, potentially offloading the data to traditional, disk-based tables; or,\n- Upgrade the service tier to one with enough in-memory storage for the data you need to keep in memory-optimized tables.\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "CPU Utilization", "title": "CPU Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CPUPercent", "datapointName": "CPUPercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "CPU", "color": "orange", "datapointName": "CPUPercent", "isVirtual": false}]}, {"name": "Deadlocks", "title": "Deadlocks", "verticalLabel": "deadlocks/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Deadlocks", "datapointName": "Deadlocks", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Deadlocks", "color": "orange", "datapointName": "Deadlocks", "isVirtual": false}]}, {"name": "Log Utilization", "title": "Log Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "LogWritePercent", "datapointName": "LogWritePercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilized", "color": "olive", "datapointName": "LogWritePercent", "isVirtual": false}]}, {"name": "Read IO Utilization", "title": "Read IO Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PhysicalDataReadPercent", "datapointName": "PhysicalDataReadPercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilized", "color": "green", "datapointName": "PhysicalDataReadPercent", "isVirtual": false}]}, {"name": "SQL Connections", "title": "SQL Connections", "verticalLabel": "connections/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BlockedByFireWall", "datapointName": "BlockedByFireWall", "consolidationFn": "average"}, {"name": "ConnectionFailed", "datapointName": "ConnectionFailed", "consolidationFn": "average"}, {"name": "ConnectionSuccessful", "datapointName": "ConnectionSuccessful", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Blocked By FireWall", "color": "orange2", "datapointName": "BlockedByFireWall", "isVirtual": false}, {"type": "line", "legend": "Failed", "color": "red", "datapointName": "ConnectionFailed", "isVirtual": false}, {"type": "line", "legend": "Successful", "color": "blue", "datapointName": "ConnectionSuccessful", "isVirtual": false}]}, {"name": "Sessions Utilization", "title": "Sessions Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SessionsPercent", "datapointName": "SessionsPercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilized", "color": "red1", "datapointName": "SessionsPercent", "isVirtual": false}]}, {"name": "Storage Detail", "title": "Storage Detail", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "Storage", "datapointName": "Storage", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Storage", "color": "silver", "datapointName": "Storage", "isVirtual": false}]}, {"name": "Storage Utilization", "title": "Storage Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "StoragePercent", "datapointName": "StoragePercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilized", "color": "fuchsia", "datapointName": "StoragePercent", "isVirtual": false}]}, {"name": "Worker Utilization", "title": "Worker Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 9, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "WorkersPercent", "datapointName": "WorkersPercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilized", "color": "fuchsia", "datapointName": "WorkersPercent", "isVirtual": false}]}, {"name": "XTP Storage Utilization", "title": "XTP Storage Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 11, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "XTPStoragePercent", "datapointName": "XTPStoragePercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilized", "color": "blue", "datapointName": "XTPStoragePercent", "isVirtual": false}]}]}

×DataSource: Ruckus_ZD_Uptime (1238)

{"name": "Ruckus_ZD_Uptime", "description": "Monitors Ruckus ZoneDirector Uptime", "appliesTo": "hasCategory(\"Ruckus_ZD\")", "searchKeywords": "zonedirector,zd,ruckus,uptime", "displayedAs": "Ruckus ZD Uptime", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostname = hostProps.get(\"system.hostname\")\ndef sysoid = hostProps.get('system.sysoid')\ndef props = hostProps.toProperties()\ndef timeout = 10000\n\ndef uptimeSeconds = 0\n\ntry\n{\n\t// Get the uptime metric\n\tdef uptimeOID = sysoid + '.4.0'\n\tuptimeString = Snmp.get(hostname, uptimeOID, props, timeout)\n\n\t// uptimeString will be in the format: 104 days, 2:33:59.83\n\t// It is currently unknown whether 'days' becomes 'day' when the uptime is in the \"one day\" range,\n\t// so the regexes are written for this possibility.\n\t// daysValue:\t\t/(\\d+)\\s+day/\n\t// hoursValue:\t\t/days?,\\s+(\\d+)/\n\t// minutesValue:\t/days?,\\s+\\d+:(\\d+)/\n\t// secondsValue:\t/days?,\\s+\\d+:\\d+:(\\d+)/\n\t// decimalValue:\t/days?,\\s+\\d+:\\d+:\\d+\\.(\\d+)/\t\t<<-- Not going to use, as we don't need to care about fractions of a second here.\n\t\n\tdaysValue = (uptimeString =~ /(\\d+)\\s+day/)[0][1].toInteger()\n\n\thoursValue = (uptimeString =~ /days?,\\s+(\\d+)/)[0][1].toInteger()\n\n\tminutesValue = (uptimeString =~ /days?,\\s+\\d+:(\\d+)/)[0][1].toInteger()\n\n\tsecondsValue = (uptimeString =~ /days?,\\s+\\d+:\\d+:(\\d+)/)[0][1].toInteger()\n\n\tuptimeSeconds = (((((daysValue * 24) + hoursValue) * 60) + minutesValue) * 60) + secondsValue\n\n\n}\n// Catch the exception.\ncatch (Exception e)\n{\n // print out the exception and return 1 to avoid deleting existing auto.props.\n println e\n return 1\n}\n\nprintln 'uptimeSeconds=' + uptimeSeconds\n\n// exit code 0\nreturn 0"}, "datapoints": [{"name": "uptimeMinutes", "description": "System uptime in minutes", "interpretMethod": "expression", "interpretExpr": "uptimeSeconds/60", "type": "gauge", "dataType": 7, "threshold": "< 60", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The Ruckus Zone Director ##HOST## is reporting it has only been up for ##VALUE## minutes placing the system into a ##LEVEL## alert level, as of ##START## or ##DURATION##.\nIf this was unexpected, please investigate the system."}, {"name": "uptimeSeconds", "description": "System uptime in seconds", "interpretMethod": "namevalue", "interpretExpr": "uptimeSeconds", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "System Uptime", "title": "System Uptime", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "uptimeSeconds", "datapointName": "uptimeSeconds", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "uptimeDays", "expr": "uptimeSeconds/60/60/24"}], "lines": [{"type": "area", "legend": "Days", "color": "teal", "datapointName": "uptimeDays", "isVirtual": true}]}]}

×DataSource: Dell_SC_Controller_Voltage (1223)

{"name": "Dell_SC_Controller_Voltage", "description": "Monitors voltage status as reported by snmp agent on Dell SC systems.", "appliesTo": "hasCategory(\"Dell_SC\")", "searchKeywords": "controller,storage,dell,compellent,voltage", "technicalNotes": "Dell SNMP only outputs valid data for Sensor Status (1=up,2=down,3=degraded) when tested from the Voltage table 1.3.6.1.4.1.674.11000.2000.500.1.2.18.1.\n\nVoltage and Critical/Normal/Warning levels via SNMP all only output 0", "displayedAs": "Dell SC Controller Voltage", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostName = hostProps.get(\"system.hostName\")\ndef props = hostProps.toProperties()\ndef timeout = 10000\n\ndef scCtlrVoltageEntryOid = \".1.3.6.1.4.1.674.11000.2000.500.1.2.18.1\"\n\n// Walk the descriptions\ndef instances = Snmp.walk(hostName, scCtlrVoltageEntryOid, props, timeout)\n\n// Loop through the returned lines\ninstances.eachLine \n{ line ->\n // Remove the prefix of the Oid to leave the instance and the result\n line = line - (scCtlrVoltageEntryOid + '.')\n\n // Split line\n lineTokens = line.split(/ = /, 2)\n instance = lineTokens[0] // 1.1\n value = lineTokens[1]\n\n // Split instance\n instanceTokens = instance.split(\"\\\\.\", 2)\n metricId = instanceTokens[0]\n instanceId = instanceTokens[1]\n // Further break out the instance into rack and device id.\n instanceIdTokens = instanceId.split(\"\\\\.\", 2)\n controllerId = instanceIdTokens[0]\n deviceId = instanceIdTokens[1]\n controllerName = Snmp.get(hostName, '.1.3.6.1.4.1.674.11000.2000.500.1.2.13.1.4.' + controllerId, props, timeout)\n switch (metricId)\n {\n case '4': // name\n println instanceId + \"##\" + controllerName + \" (\" + value.trim() + \")\"\n break\n } // End: switch\n} // End: instances.eachLine\n\nreturn 0"}, "groupMethod": "none"}, "datapoints": [{"name": "VoltageStatus", "description": "Status of Controller Voltage Sensor\n\nStatus Code:\n1 = up\n2 = down\n3 = degraded", "config": {"oid": ".1.3.6.1.4.1.674.11000.2000.500.1.2.18.1.3.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "threshold": ">= 2 2", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "Voltage Status ##INSTANCE## on Dell_SC host ##HOST## is reporting a status code of ##VALUE## putting the device into ##LEVEL## level.\n\nThis started at ##START## -- or ##DURATION## ago.\n\nStatus Code:\n1 = up\n2 = down\n3 = degraded"}], "graphs": [{"name": "Controller Voltage Sensor Status", "title": "Controller Voltage Sensor Status", "verticalLabel": "1=up, 2=down, 3=degraded", "min": 0.0, "max": 4.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "VoltageStatus", "datapointName": "VoltageStatus", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "##INSTANCE##", "color": "olive", "datapointName": "VoltageStatus", "isVirtual": false}]}], "overviewGraphs": [{"name": "Voltage Status Overview", "title": "Voltage Status Overview", "verticalLabel": "1=up, 2=down, 3=degraded", "min": 0.0, "max": 4.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "VoltageStatus", "datapointName": "VoltageStatus", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "area", "legend": "##INSTANCE## ", "color": "silver", "datapointName": "VoltageStatus", "isVirtual": false}]}]}

×DataSource: Dell_SC_IOModules (1218)

{"name": "Dell_SC_IOModules", "description": "Monitors io module status as reported by snmp agent in Dell SC systems", "appliesTo": "hasCategory(\"Dell_SC\")", "searchKeywords": "module,storage,dell,compellent", "displayedAs": "Dell SC I/O Modules", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef hostName = hostProps.get(\"system.hostName\")\ndef props = hostProps.toProperties()\ndef timeout = 10000\n\ndef scEnclIOModEntryOid = \"1.3.6.1.4.1.674.11000.2000.500.1.2.22.1\"\n\n// Walk the descriptions\ndef instances = Snmp.walk(hostName, scEnclIOModEntryOid, props, timeout)\n\n// Loop through the returned lines\ninstances.eachLine \n{ line ->\n // Remove the prefix of the Oid to leave the instance and the result\n line = line - (scEnclIOModEntryOid + '.')\n\n // Split line\n lineTokens = line.split(/ = /, 2)\n instance = lineTokens[0] // 1.1\n value = lineTokens[1]\n\n // Split instance\n instanceTokens = instance.split(\"\\\\.\", 2);\n metricId = instanceTokens[0]\n instanceId = instanceTokens[1]\n\n // Further break out the instance into rack and device id.\n instanceIdTokens = instanceId.split(\"\\\\.\", 2)\n rackId = instanceIdTokens[0]\n deviceId = instanceIdTokens[1]\n\n switch (metricId)\n {\n case '4': // position\n println instanceId + \"##Rack: \" + rackId + \" / Position: \" + value.trim()\n break\n } // End: switch\n} // End: instances.eachLine\n\nreturn 0"}, "groupMethod": "none"}, "datapoints": [{"name": "IOModuleStatus", "description": "Status of I/O Modules\n\nStatus Code:\n1 = up\n2 = down\n3 = degraded", "config": {"oid": "1.3.6.1.4.1.674.11000.2000.500.1.2.22.1.3.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "threshold": ">= 2 2", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "I/O Module Status on ##INSTANCE## a Dell_SC host ##HOST## is reported to have a value of ##VALUE## which puts this device into ##LEVEL## level.\n\nThis started at ##START## -- or ##DURATION## ago.\n\nStatus Code:\n1 = up\n2 = down\n3 = degraded"}], "graphs": [{"name": "I/O Module Status", "title": "I/O Module Status", "verticalLabel": "1=up, 2=down, 3=degraded", "min": 0.0, "max": 4.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "IOModuleStatus", "datapointName": "IOModuleStatus", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "IO Module Status", "color": "blue", "datapointName": "IOModuleStatus", "isVirtual": false}]}], "overviewGraphs": [{"name": "IO Module Status Overview", "title": "IO Module Status Overview", "verticalLabel": "1=up, 2=down, 3=degraded", "min": 0.0, "max": 4.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "IOModuleStatus", "datapointName": "IOModuleStatus", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "area", "legend": "##INSTANCE##", "color": "silver", "datapointName": "IOModuleStatus", "isVirtual": false}]}]}

×DataSource: PaloAlto_FW_IPSecTunnelStats (138)

{"name": "PaloAlto_FW_IPSecTunnelStats", "description": "PaloAlto firewall IPSec tunnels status and statistics.", "appliesTo": "hasCategory(\"PaloAlto\")", "searchKeywords": "vpn,ipsec,tunnel,paloalto", "technicalNotes": "- Requires property \"paloalto.apikey.pass\" set to API token \n- An alternative port can be specified using the optional property \"paloalto.port\"\n\nSupport Documentation: https://www.logicmonitor.com/support/monitoring/networking-firewalls/palo-alto-firewalls", "displayedAs": "Tunnel Stats", "collectionInterval": "2m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef host = hostProps.get(\"system.hostname\")\ndef port = hostProps.get(\"paloalto.port\")?: 443\ndef apikey = hostProps.get(\"paloalto.apikey.pass\")?.trim()\nif (apikey == null) {\n println \"No paloalto.apikey.pass set\"\n return 1\n}\n\ndef response\ndef command = URLEncoder.encode(\"<show><running><tunnel><flow><all></all></flow></tunnel></running></show>\", \"UTF-8\")\ndef url = \"https://${host}:$port/api/?type=op&key=${apikey}&cmd=${command}\"\ndef getRequestConn = url.toURL().openConnection()\nif (getRequestConn.responseCode == 200) {\n response = new XmlSlurper().parseText(getRequestConn.content.text)\n} else {\n println \"Failed to GET <show><running><tunnel><flow><all></all></flow></tunnel></running></show>\\nStatus code: ${getRequestConn.responseCode}\"\n return 1\n}\n\ndef tunnelData = response.result.IPSec.entry\ntunnelData.each { it ->\n def name = it.name\n def tunnelid = it.id\n def localip = it.localip\n def peerip = it.peerip\n println \"${tunnelid}##${name} [ID:${tunnelid}]##local:${localip} - peer:${peerip}\"\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef host = hostProps.get(\"system.hostname\")\ndef port = hostProps.get(\"paloalto.port\")?: 443\ndef apikey = hostProps.get(\"paloalto.apikey.pass\")?.trim()\nif (apikey == null) {\n println \"No paloalto.apikey.pass set\"\n return 1\n}\n\ndef targetMetrics = [\"state\", \"pkt-encap\", \"pkt-decap\", \"byte-encap\", \"byte-decap\"]\n\ndef stateMap = [\"inactive\": 0,\n \"active\" : 1,\n \"init\" : 2]\n\n\ndef tunnelData\ndef command = URLEncoder.encode(\"<show><running><tunnel><flow><all></all></flow></tunnel></running></show>\", \"UTF-8\")\ndef url = \"https://${host}:$port/api/?type=op&key=${apikey}&cmd=${command}\"\ndef getRequestConn1 = url.toURL().openConnection()\nif (getRequestConn1.responseCode == 200) {\n tunnelData = new XmlSlurper().parseText(getRequestConn1.content.text)\n} else {\n println \"Failed to GET <show><running><tunnel><flow><all></all></flow></tunnel></running></show>\\nStatus code: ${getRequestConn1.responseCode}\"\n return 1\n}\n\ntunnelData.result.IPSec.entry.id.each { tunnelId ->\n def tunnelStats\n def tunnelStatsCmd = URLEncoder.encode(\"<show><running><tunnel><flow><tunnel-id>\" + tunnelId + \"</tunnel-id></flow></tunnel></running></show>\", \"UTF-8\")\n def tunnelUrl = \"https://${host}/api/?type=op&key=${apikey}&cmd=${tunnelStatsCmd}\"\n def getRequestConn2 = tunnelUrl.toURL().openConnection()\n if (getRequestConn2.responseCode == 200) {\n tunnelStats = new XmlSlurper().parseText(getRequestConn2.content.text)\n } else {\n println \"Failed to GET <show><running><tunnel><flow><tunnel-id>\" + tunnelId + \"</tunnel-id></flow></tunnel></running></show>\\nStatus code: ${getRequestConn2.responseCode}\"\n return 1\n }\n\n tunnelStats.result.IPSec.entry.children().each() { tunnelStat ->\n def stat = tunnelStat.name()\n def value = tunnelStat.text()\n if (targetMetrics.contains(stat)) {\n if (stat.contains(\"state\")) {\n println \"${tunnelId}.${stat}=${stateMap[value]}\"\n } else {\n println \"${tunnelId}.${stat}=${value}\"\n }\n }\n }\n}\n\nreturn 0"}, "datapoints": [{"name": "InBytes", "description": "Tunnel inbound bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.byte-decap", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "InPackets", "description": "Tunnel inbound packets per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pkt-decap", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OutBytes", "description": "Tunnel outgoing bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.byte-encap", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OutPackets", "description": "Tunnel outgoing packets per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pkt-encap", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TunnelState", "description": "State of the tunnel.\n\nStatus Codes:\n\n0=inactive\n1=active\n2=init", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.state", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "threshold": "= 0", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "The PaloAlto host ##HOST## is reporting that tunnel ##INSTANCE## is down placing the device in a ##LEVEL## state (##VALUE##).\n\nThis started at ##START## - or ##DURATION## ago."}], "graphs": [{"name": "Packet Transmission", "title": "Packet Transmission", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "InPackets", "datapointName": "InPackets", "consolidationFn": "average"}, {"name": "OutPackets", "datapointName": "OutPackets", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "In", "color": "silver", "datapointName": "InPackets", "isVirtual": false}, {"type": "line", "legend": "Out", "color": "lime", "datapointName": "OutPackets", "isVirtual": false}]}, {"name": "State", "title": "State", "verticalLabel": "0 = inactive, 1 = active", "min": -1.0, "max": 2.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "TunnelState", "datapointName": "TunnelState", "consolidationFn": "min"}], "lines": [{"type": "area", "legend": "State", "color": "aqua", "datapointName": "TunnelState", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "InBytes", "datapointName": "InBytes", "consolidationFn": "average"}, {"name": "OutBytes", "datapointName": "OutBytes", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "In", "color": "silver", "datapointName": "InBytes", "isVirtual": false}, {"type": "line", "legend": "Out", "color": "lime", "datapointName": "OutBytes", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Down Tunnels", "title": "Top 10 Down Tunnels", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "TunnelState", "datapointName": "TunnelState", "consolidationFn": "min", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "DownTunnel", "expr": "if(eq(TunnelState, 0), 1, unkn())"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "DownTunnel", "isVirtual": true}]}, {"name": "Top 10 Tunnels By State", "title": "Top 10 Tunnels By State", "verticalLabel": "0 = inactive, 1 = active", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "TunnelState", "datapointName": "TunnelState", "consolidationFn": "min", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "TunnelState", "isVirtual": false}]}, {"name": "Top 10 Tunnels By Total Bytes", "title": "Top 10 Tunnels By Total Bytes", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "InBytes", "datapointName": "InBytes", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "OutBytes", "datapointName": "OutBytes", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "TotalBytes", "expr": "InBytes + OutBytes"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "TotalBytes", "isVirtual": true}]}, {"name": "Top 10 Tunnels By Total Packets", "title": "Top 10 Tunnels By Total Packets", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "InPackets", "datapointName": "InPackets", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "OutPackets", "datapointName": "OutPackets", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "TotalPackets", "expr": "InPackets + OutPackets"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "TotalPackets", "isVirtual": true}]}]}

×DataSource: Cisco_vManage_Alarms (529)

{"name": "Cisco_vManage_Alarms", "description": "Monitors vManage portal active and cleared alarms.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "sdwan,vmanage,networking,cisco,viptela", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port", "displayedAs": "Cisco vManage: Alarms", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// Unique key for this module\nsnip.keySuffix = \"_Alarms\"\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def alarms = snip.getAlarms()\n if (alarms) {\n lmEmit.dp(\"count\", alarms.data?.last()?.count)\n lmEmit.dp(\"cleared_count\", alarms.data?.last()?.cleared_count)\n }\n}\nelse {\n // Try logging out of the session we have cached\n snip.logout()\n // Update cache with new session\n snip.rewriteCachedSession()\n // Double check that what we have is now good\n if (snip.checkCachedCreds()) {\n def alarms = snip.getAlarms()\n if (alarms) {\n lmEmit.dp(\"count\", alarms.data?.last()?.count)\n lmEmit.dp(\"cleared_count\", alarms.data?.last()?.cleared_count)\n }\n }\n else {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n }\n}\n\nreturn 0"}, "datapoints": [{"name": "cleared_count", "description": "Total number of cleared alarms.", "interpretMethod": "namevalue", "interpretExpr": "cleared_count", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cleared_delta", "description": "Cleared alarms delta changes.", "interpretMethod": "expression", "interpretExpr": "cleared_rate * ##POLLINTERVAL##", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cleared_rate", "description": "Cleared rate, per second. Will be used by a complex datapoint.", "interpretMethod": "namevalue", "interpretExpr": "cleared_count", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "count", "description": "Number of active alarms.", "interpretMethod": "namevalue", "interpretExpr": "count", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Active Alarms", "title": "Active Alarms", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "count", "datapointName": "count", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Alarm", "color": "red2", "datapointName": "count", "isVirtual": false}]}, {"name": "Cleared Alarms", "title": "Cleared Alarms", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cleared_delta", "datapointName": "cleared_delta", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "Cleared", "color": "olive", "datapointName": "cleared_delta", "isVirtual": false}]}, {"name": "Total Cleared Alarms", "title": "Total Cleared Alarms", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cleared_count", "datapointName": "cleared_count", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Cleared", "color": "gray", "datapointName": "cleared_count", "isVirtual": false}]}]}

×DataSource: Cisco_vManage_ApplicationAwareRoutingSLAClasses (528)

{"name": "Cisco_vManage_ApplicationAwareRoutingSLAClasses", "description": "Monitors Application Aware Routing metrics.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "sdwan,vmanage,networking,cisco,viptela", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port", "displayedAs": "Cisco vManage: Application Aware Routing SLA Classes", "collectionInterval": "4m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.util.Settings\nimport java.util.concurrent.ConcurrentHashMap\nimport java.util.concurrent.Callable\nimport java.util.concurrent.Executors\nimport java.util.concurrent.TimeUnit\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Get start time for script for threadpool cleanup\nlong startTime = System.currentTimeMillis()\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\n// Get threadpoolSize, defaults to 5 if not configured; may only be configured for 1-16\nInteger threadpoolSize = Math.max(Math.min((hostProps.get(\"vmanage.threadpoolsize\") ?: \"16\").toInteger(), 16), 1)\n\n// Get the script timeout and convert to ms\nInteger timeout = Settings.getSetting(\"collector.script.timeout\").toInteger() * 1000\nsnip.LMDebugPrint(\"Script timeout set to ${timeout / 1000} seconds\\n\")\n\nif (snip.checkCachedCreds()) {\n def deviceResponse = snip.getDevice()\n\n // In large environments, API response for the following calls takes too long to run serially\n // Create a thread pool for parallel collection\n def slaThreadPool = Executors.newFixedThreadPool(threadpoolSize)\n snip.LMDebugPrint(\"\\nCreating threadpool with ${threadpoolSize} threads for collecting application SLA data.\")\n\n snip.LMDebugPrint(\"Device ids returned: ${deviceResponse.data.deviceId}\")\n snip.LMDebugPrint(\"${deviceResponse.data.size()} devices to iterate\\n__________\\n\\n\")\n\n try {\n deviceResponse.'data'.each { device ->\n // Submit the work to threadpool\n slaThreadPool.submit( {\n def appSLA = snip.getDeviceAppSLA(device.'deviceId')\n\n appSLA?.'data'?.each { output ->\n String wildvalue = lmEmit.sanitizeWildvalue(output.'vdevice-dataKey')\n String wildalias = lmEmit.sanitizeWildalias(\"${output.'vdevice-host-name'} : ${output.'index'}\")\n String descr = \"${output.'name'} (${output.'vdevice-name'})\"\n Map ilps = [\n \"auto.cisco.vmanage.vdevice.hostname\" : output.'vdevice-host-name',\n \"auto.cisco.vmanage.device.id\" : device.'deviceId'\n ]\n lmEmit.instance(wildvalue, wildalias, descr, ilps)\n }\n } as Callable)\n }\n }\n finally {\n // Initiate an orderly shutdown of the threadpool\n slaThreadPool.shutdown()\n\n long now = System.currentTimeMillis()\n snip.LMDebugPrint(\"Current time: ${now}\\t(${now - startTime} ms elapsed)\")\n\n // Calculate the remaining execution time\n def remaining = ((timeout - now + startTime) - 5000)\n snip.LMDebugPrint(\"Calculated remaining script time as ${remaining / 1000} seconds\")\n\n // Block until the script times out or all tasks have finished executing\n try {\n if (!slaThreadPool.awaitTermination(remaining, TimeUnit.MILLISECONDS)) {\n snip.LMDebugPrint(\"Ran out of time to finish execution, shutting down the rest of the threads\")\n // Force all remaining tasks in the pool to abort\n slaThreadPool.shutdownNow()\n }\n }\n catch (e) {\n slaThreadPool.shutdownNow()\n }\n long newNow = System.currentTimeMillis()\n snip.LMDebugPrint(\"Shutdown time: ${newNow}\\t(${newNow - startTime} ms elapsed)\")\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed.\")\n return 1\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n String wildvalue = instanceProps.get(\"wildvalue\")\n String deviceId = instanceProps.get(\"auto.cisco.vmanage.device.id\")\n\n def appSLA = snip.getDeviceAppSLA(deviceId)\n // Filter down to data for this specific instance\n def results = appSLA.data.findAll { it.'vdevice-dataKey'.toString() == wildvalue }\n\n if (results) {\n lmEmit.dp(wildvalue, \"loss\", results[0].'loss')\n lmEmit.dp(wildvalue, \"jitter\", results[0].'jitter')\n lmEmit.dp(wildvalue, \"latency\", results[0].'latency')\n }\n else {\n println \"Failed to find results for this instance. Try debug mode.\"\n snip.LMDebug(\"No results for ${wildvalue} on ${deviceId}\")\n return 1\n }\n} \nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "datapoints": [{"name": "jitter", "description": "Measured jitter, in milliseconds", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.jitter", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "latency", "description": "Measured latency, in milliseconds", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.latency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "loss", "description": "Measured loss percentage", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.loss", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Jitter", "title": "Jitter", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "jitter", "datapointName": "jitter", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Jitter", "color": "blue", "datapointName": "jitter", "isVirtual": false}]}, {"name": "Latency", "title": "Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "latency", "datapointName": "latency", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Latency", "color": "fuchsia", "datapointName": "latency", "isVirtual": false}]}, {"name": "Percent Loss", "title": "Percent Loss", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "loss", "datapointName": "loss", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Percent Loss", "color": "orange2", "datapointName": "loss", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 SLA Classes by Jitter", "title": "Top 10 SLA Classes by Jitter", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "jitter", "datapointName": "jitter", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "jitter", "isVirtual": false}]}, {"name": "Top 10 SLA Classes by Latency", "title": "Top 10 SLA Classes by Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "latency", "datapointName": "latency", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "latency", "isVirtual": false}]}, {"name": "Top 10 SLA Classes by Percent Loss", "title": "Top 10 SLA Classes by Percent Loss", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "loss", "datapointName": "loss", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "loss", "isVirtual": false}]}]}

×DataSource: Cisco_vManage_BFDDeviceSummary (527)

{"name": "Cisco_vManage_BFDDeviceSummary", "description": "Monitors BFD session metrics by device.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "sdwan,vmanage,cisco", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port", "displayedAs": "Cisco vManage: BFD Device Summary", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.util.Settings\nimport java.util.concurrent.ConcurrentHashMap\nimport java.util.concurrent.Callable\nimport java.util.concurrent.Executors\nimport java.util.concurrent.TimeUnit\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Get start time for script for threadpool cleanup\nlong startTime = System.currentTimeMillis()\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\n// Get threadpoolSize, defaults to 5 if not configured; may only be configured for 1-20\nInteger threadpoolSize = Math.max(Math.min((hostProps.get(\"vmanage.threadpoolsize\") ?: \"5\").toInteger(), 20), 1)\n\n// Get the script timeout and convert to ms\nInteger timeout = Settings.getSetting(\"collector.script.timeout\").toInteger() * 1000\nsnip.LMDebugPrint(\"Script timeout set to ${timeout / 1000} seconds\\n\")\n\n// Get data\nif (snip.checkCachedCreds()) {\n def deviceResponse = snip.getDevice()\n\n // In large environments, API response for the following calls takes too long to run serially\n // Create a thread pool for parallel collection\n def bfdThreadPool = Executors.newFixedThreadPool(threadpoolSize)\n snip.LMDebugPrint(\"\\nCreating threadpool with ${threadpoolSize} threads for collecting BFD data.\")\n\n snip.LMDebugPrint(\"Device ids returned: ${deviceResponse.data.deviceId}\")\n snip.LMDebugPrint(\"${deviceResponse.data.size()} devices to iterate\\n__________\\n\\n\")\n\n try {\n deviceResponse?.'data'.each { device ->\n // Submit the work to threadpool\n bfdThreadPool.submit( {\n if (device.'bfdSessions') {\n String wildvalue = device.'host-name'.toString().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")\n def bfdSummary = snip.getDeviceBFD(device.'deviceId')\n\n bfdSummary.'data'.each { bfdInfo ->\n String wvSuffix = bfdInfo.'if-name'.toString().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")\n\n String wildv = \"${wildvalue}_${wvSuffix}\"\n String wilda = \"${device.'host-name'} (${bfdInfo.'if-name'})\"\n String descr = \"${bfdInfo.'if-name'} -> ${device.'system-ip'} | Site ID: ${device.'site-id'}\"\n Map ilps = [\n \"auto.cisco.vmanage.device.id\" : lmEmit.sanitizePropertyValue(device.'deviceId'),\n \"auto.cisco.vmanage.device.if\" : lmEmit.sanitizePropertyValue(bfdInfo.'if-name'),\n \"auto.cisco.vmanage.device.type\" : lmEmit.sanitizePropertyValue(device.'device-type'),\n \"auto.cisco.vmanage.device.os\" : lmEmit.sanitizePropertyValue(device.'device-os'),\n \"auto.cisco.vmanage.device.model\" : lmEmit.sanitizePropertyValue(device.'device-model'),\n \"auto.cisco.vmanage.device.platform\" : lmEmit.sanitizePropertyValue(device.'platform'),\n \"auto.cisco.vmanage.device.timezone\" : lmEmit.sanitizePropertyValue(device.'timezone'),\n \"auto.cisco.vmanage.device.version\" : lmEmit.sanitizePropertyValue(device.'version'),\n \"auto.cisco.vmanage.device.board-serial\" : lmEmit.sanitizePropertyValue(device.'board-serial'),\n \"auto.cisco.vmanage.device.device-model\" : lmEmit.sanitizePropertyValue(device.'device-model'),\n \"auto.cisco.vmanage.device.connected_vManages\" : lmEmit.sanitizePropertyValue(device.'connectedVManages').replace('\"', ''),\n \"auto.cisco.vmanage.device.site-id\" : lmEmit.sanitizePropertyValue(\"Site ID: ${device.'site-id'}\")\n ]\n lmEmit.instance(wildv, wilda, descr, ilps)\n }\n }\n } as Callable)\n }\n }\n finally {\n // Initiate an orderly shutdown of the threadpool\n bfdThreadPool.shutdown()\n\n long now = System.currentTimeMillis()\n snip.LMDebugPrint(\"Current time: ${now}\\t(${now - startTime} ms elapsed)\")\n\n // Calculate the remaining execution time\n def remaining = ((timeout - now + startTime) - 5000)\n snip.LMDebugPrint(\"Calculated remaining script time as ${remaining / 1000} seconds\")\n\n // Block until the script times out or all tasks have finished executing\n try {\n if (!bfdThreadPool.awaitTermination(remaining, TimeUnit.MILLISECONDS)) {\n snip.LMDebugPrint(\"Ran out of time to finish execution, shutting down the rest of the threads\")\n // Force all remaining tasks in the pool to abort\n bfdThreadPool.shutdownNow()\n }\n }\n catch (e) {\n bfdThreadPool.shutdownNow()\n }\n long newNow = System.currentTimeMillis()\n snip.LMDebugPrint(\"Shutdown time: ${newNow}\\t(${newNow - startTime} ms elapsed)\")\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def wildvalue = instanceProps.get(\"wildvalue\")\n def deviceId = instanceProps.get(\"auto.cisco.vmanage.device.id\")\n def deviceIf = instanceProps.get(\"auto.cisco.vmanage.device.if\")\n\n def bfdSummary = snip.getDeviceBFD(deviceId)\n def results = bfdSummary.'data'.find { it.'if-name'.toString() == deviceIf }\n\n if (results) {\n // Different versions may return different keys\n lmEmit.dp(wildvalue, \"bfd_sessions_max\", (results.'bfd-sessions-max' ?: results.'sessions-max'))\n lmEmit.dp(wildvalue, \"bfd_sessions_flap\", (results.'bfd-sessions-flap' ?: results.'sessions-flap'))\n lmEmit.dp(wildvalue, \"bfd_sessions_up\", (results.'bfd-sessions-up' ?: results.'sessions-up'))\n lmEmit.dp(wildvalue, \"bfd_sessions_total\", (results.'bfd-sessions-total' ?: results.'sessions-total'))\n }\n else {\n println \"Failed to find results for this instance. Try debug mode.\"\n snip.LMDebug(\"No results for ${wildvalue} IF ${deviceIf} on ${deviceId}\")\n return 1\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "datapoints": [{"name": "bfd_sessions_down", "description": "Calculated number of BFD sessions down.", "interpretMethod": "expression", "interpretExpr": "bfd_sessions_total-bfd_sessions_up", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "bfd_sessions_flap", "description": "Number of session flaps that have occurred.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.bfd_sessions_flap", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "bfd_sessions_flap_rate", "description": "Number of session flaps per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.bfd_sessions_flap", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "bfd_sessions_max", "description": "Maximum number of BFD sessions.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.bfd_sessions_max", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "bfd_sessions_total", "description": "Total number of BFD sessions.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.bfd_sessions_total", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "bfd_sessions_up", "description": "Number of BFD sessions that are up.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.bfd_sessions_up", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Session Flap Rate", "title": "Session Flap Rate", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "bfd_sessions_flap_rate", "datapointName": "bfd_sessions_flap_rate", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Session Flaps", "color": "fuchsia", "datapointName": "bfd_sessions_flap_rate", "isVirtual": false}]}, {"name": "Session Flaps", "title": "Session Flaps", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "bfd_sessions_flap", "datapointName": "bfd_sessions_flap", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Session Flaps", "color": "black", "datapointName": "bfd_sessions_flap", "isVirtual": false}]}, {"name": "Sessions", "title": "Sessions", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "bfd_sessions_down", "datapointName": "bfd_sessions_down", "consolidationFn": "average"}, {"name": "bfd_sessions_max", "datapointName": "bfd_sessions_max", "consolidationFn": "average"}, {"name": "bfd_sessions_total", "datapointName": "bfd_sessions_total", "consolidationFn": "average"}, {"name": "bfd_sessions_up", "datapointName": "bfd_sessions_up", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Down", "color": "orange2", "datapointName": "bfd_sessions_down", "isVirtual": false}, {"type": "line", "legend": "Max", "color": "fuchsia", "datapointName": "bfd_sessions_max", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "bfd_sessions_total", "isVirtual": false}, {"type": "stack", "legend": "Up", "color": "lime", "datapointName": "bfd_sessions_up", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Devices by Down Sessions", "title": "Top 10 Devices by Down Sessions", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "bfd_sessions_down", "datapointName": "bfd_sessions_down", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "bfd_sessions_down", "isVirtual": false}]}, {"name": "Top 10 Devices by Session Flap Rate", "title": "Top 10 Devices by Session Flap Rate", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "bfd_sessions_flap_rate", "datapointName": "bfd_sessions_flap_rate", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "bfd_sessions_flap_rate", "isVirtual": false}]}, {"name": "Top 10 Devices by Session Flaps", "title": "Top 10 Devices by Session Flaps", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "bfd_sessions_flap", "datapointName": "bfd_sessions_flap", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "bfd_sessions_flap", "isVirtual": false}]}, {"name": "Top 10 Devices by Up Sessions", "title": "Top 10 Devices by Up Sessions", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "bfd_sessions_up", "datapointName": "bfd_sessions_up", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "bfd_sessions_up", "isVirtual": false}]}]}

×DataSource: Cisco_vManage_BFDPerTLOC (526)

{"name": "Cisco_vManage_BFDPerTLOC", "description": "Monitors BFD session metrics by device per TLOC (transport location).", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "sdwan,vmanage,cisco", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port", "displayedAs": "Cisco vManage: BFD Summary Per TLOC", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.util.Settings\nimport java.util.concurrent.ConcurrentHashMap\nimport java.util.concurrent.Callable\nimport java.util.concurrent.Executors\nimport java.util.concurrent.TimeUnit\n\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Get start time for script for threadpool cleanup\nlong startTime = System.currentTimeMillis()\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\n// Get threadpoolSize, defaults to 5 if not configured; may only be configured for 1-20\nInteger threadpoolSize = Math.max(Math.min((hostProps.get(\"vmanage.threadpoolsize\") ?: \"5\").toInteger(), 20), 1)\n\n// Get the script timeout and convert to ms\nInteger timeout = Settings.getSetting(\"collector.script.timeout\").toInteger() * 1000\nsnip.LMDebugPrint(\"Script timeout set to ${timeout / 1000} seconds\\n\")\n\n// Get data\nif (snip.checkCachedCreds()) {\n def deviceResponse = snip.getDevice()\n\n // In large environments, API response for the following calls takes too long to run serially\n // Create a thread pool for parallel collection\n def bfdThreadPool = Executors.newFixedThreadPool(threadpoolSize)\n snip.LMDebugPrint(\"\\nCreating threadpool with ${threadpoolSize} threads for collecting BFD data.\")\n\n snip.LMDebugPrint(\"Device ids returned: ${deviceResponse.data.deviceId}\")\n snip.LMDebugPrint(\"${deviceResponse.data.size()} devices to iterate\\n__________\\n\\n\")\n\n try {\n deviceResponse?.'data'.each { device ->\n // Submit the work to threadpool\n bfdThreadPool.submit( {\n if (device?.'bfdSessions') {\n def bfdPerTLOC = snip.getDeviceBFD(device.'deviceId')\n\n bfdPerTLOC?.'data'?.each { bfdInfo ->\n String wildvalue = lmEmit.sanitizeWildvalue(\"${bfdInfo.'vdevice-host-name'}_${bfdInfo.'if-name'}\")\n String wildalias = lmEmit.sanitizeWildalias(\"${bfdInfo.'vdevice-host-name'} : ${bfdInfo.'if-name'}\")\n String descr = \"${bfdInfo.'vdevice-name'} | ${bfdInfo.'encap'}\"\n Map ilps = [\n \"auto.cisco.vmanage.device.id\" : device.'deviceId',\n \"auto.cisco.vmanage.vdevice.hostname\" : bfdInfo.'vdevice-host-name',\n \"auto.cisco.vmanage.if.name\" : bfdInfo.'if-name'\n ]\n lmEmit.instance(wildvalue, wildalias, descr, ilps)\n }\n }\n } as Callable)\n }\n }\n finally {\n // Initiate an orderly shutdown of the threadpool\n bfdThreadPool.shutdown()\n\n def now = System.currentTimeMillis()\n snip.LMDebugPrint(\"Current time: ${now}\\t(${now - startTime} ms elapsed)\")\n\n // Calculate the remaining execution time\n def remaining = ((timeout - now + startTime) - 5000)\n snip.LMDebugPrint(\"Calculated remaining script time as ${remaining / 1000} seconds\")\n\n // Block until the script times out or all tasks have finished executing\n try {\n if (!bfdThreadPool.awaitTermination(remaining, TimeUnit.MILLISECONDS)) {\n snip.LMDebugPrint(\"Ran out of time to finish execution, shutting down the rest of the threads\")\n // Force all remaining tasks in the pool to abort\n bfdThreadPool.shutdownNow()\n }\n }\n catch (e) {\n bfdThreadPool.shutdownNow()\n }\n def newNow = System.currentTimeMillis()\n snip.LMDebugPrint(\"Shutdown time: ${newNow}\\t(${newNow - startTime} ms elapsed)\")\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n String wildvalue = instanceProps.get(\"wildvalue\")\n String deviceId = instanceProps.get(\"auto.cisco.vmanage.device.id\")\n String ifName = instanceProps.get(\"auto.cisco.vmanage.if.name\")\n\n def bfdPerTLOC = snip.getDeviceBFD(deviceId)\n def results = bfdPerTLOC.data.findAll { it.'if-name'.toString() == ifName }\n\n if (results) {\n lmEmit.dp(wildvalue, \"sessions_flap\", results[0].'sessions-flap')\n lmEmit.dp(wildvalue, \"sessions_total\", results[0].'sessions-total')\n lmEmit.dp(wildvalue, \"sessions_up\", results[0].'sessions-up')\n }\n else {\n println \"Failed to find results for this instance. Try debug mode.\"\n snip.LMDebug(\"No results for ${wildvalue} IF ${ifName} on ${deviceId}\")\n return 1\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "datapoints": [{"name": "sessions_down", "description": "Number of down sessions.", "interpretMethod": "expression", "interpretExpr": "sessions_total-sessions_up", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sessions_flap", "description": "Number of session flaps.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sessions_flap", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sessions_total", "description": "Total number of sessions.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sessions_total", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sessions_up", "description": "Number of up sessions.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sessions_up", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Session Flaps", "title": "Session Flaps", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "sessions_flap", "datapointName": "sessions_flap", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Session Flaps", "color": "black", "datapointName": "sessions_flap", "isVirtual": false}]}, {"name": "Sessions", "title": "Sessions", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "sessions_down", "datapointName": "sessions_down", "consolidationFn": "average"}, {"name": "sessions_total", "datapointName": "sessions_total", "consolidationFn": "average"}, {"name": "sessions_up", "datapointName": "sessions_up", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Down", "color": "orange2", "datapointName": "sessions_down", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "sessions_total", "isVirtual": false}, {"type": "stack", "legend": "Up", "color": "olive", "datapointName": "sessions_up", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 TLOCs by Down Sessions", "title": "Top 10 TLOCs by Down Sessions", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "sessions_down", "datapointName": "sessions_down", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "sessions_down", "isVirtual": false}]}, {"name": "Top 10 TLOCs by Session Flaps", "title": "Top 10 TLOCs by Session Flaps", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "sessions_flap", "datapointName": "sessions_flap", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "sessions_flap", "isVirtual": false}]}, {"name": "Top 10 TLOCs by Up Sessions", "title": "Top 10 TLOCs by Up Sessions", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "sessions_up", "datapointName": "sessions_up", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "sessions_up", "isVirtual": false}]}]}

×DataSource: Cisco_vManage_CertificateSummary (525)

{"name": "Cisco_vManage_CertificateSummary", "description": "Display information about certificates.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "sdwan,vmanage,networking,cisco,viptela", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port\n\n- https://sdwan-docs.cisco.com/Product_Documentation/Command_Reference/Command_Reference/vManage_REST_APIs/Troubleshooting_APIs/Dashboard#Certificate_Summary", "displayedAs": "Cisco vManage: Certificate Summary", "collectionInterval": "10m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// Unique key for this module\nsnip.keySuffix = \"_Certs\"\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n\tdef certs = snip.getCert()\n if (certs) {\n lmEmit.dp(\"invalid\", certs.data?.last()?.invalid)\n lmEmit.dp(\"warning\", certs.data?.last()?.warning)\n }\n}\nelse {\n // Try logging out of the session we have cached\n snip.logout()\n // Update cache with new session\n snip.rewriteCachedSession()\n // Double check that what we have is now good\n if (snip.checkCachedCreds()) {\n def certs = snip.getCert()\n if (certs) {\n lmEmit.dp(\"invalid\", certs.data?.last()?.invalid)\n lmEmit.dp(\"warning\", certs.data?.last()?.warning)\n }\n }\n else {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n }\n}\n\nreturn 0"}, "datapoints": [{"name": "invalid", "description": "Number of invalid certs.", "interpretMethod": "namevalue", "interpretExpr": "invalid", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "warning", "description": "Number of certs in warning state.", "interpretMethod": "namevalue", "interpretExpr": "warning", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Certificates Errors", "title": "Certificates Errors", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "invalid", "datapointName": "invalid", "consolidationFn": "max"}, {"name": "warning", "datapointName": "warning", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "Invalid", "color": "orange2", "datapointName": "invalid", "isVirtual": false}, {"type": "stack", "legend": "Warning", "color": "red2", "datapointName": "warning", "isVirtual": false}]}]}

×DataSource: Cisco_vManage_ControlWANInterfaces (524)

{"name": "Cisco_vManage_ControlWANInterfaces", "description": "Display information about the WAN interface control connection.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "sdwan,vmanage,networking,cisco,viptela", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port\n\n- https://sdwan-docs.cisco.com/Product_Documentation/Command_Reference/Command_Reference/vManage_REST_APIs/Bulk_APIs/State", "displayedAs": "Cisco vManage: Control WAN Interfaces", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def ifResponse = snip.getWANIf()\n\n ifResponse?.'data'.each { it ->\n String wildvalue = lmEmit.sanitizeWildvalue(\"${it.'vdevice-dataKey'}\".toString())\n String descr = \"${it.'vdevice-host-name'} || ${it.'interface'} Public IP: ${it.'public-ip'}:${it.'public-port'} || ${it.'color'}\"\n Map ilps = [\n \"auto.cisco.vmanage.interface.color\" : it.'color',\n \"auto.cisco.vmanage.interface.private-ip\" : it.'private-ip',\n \"auto.cisco.vmanage.interface.private-port\" : it.'private-port',\n \"auto.cisco.vmanage.interface.nat-type\" : it.'nat-type',\n \"auto.cisco.vmanage.interface.carrier\" : it.'carrier',\n \"auto.cisco.vmanage.interface.public-port\" : it.'public-port'\n ]\n lmEmit.instance(wildvalue, wildvalue, descr, ilps)\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "groupMethod": "ilp", "groupExpr": "auto.cisco.vmanage.interface.color"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def ifResponse = snip.getWANIf()\n\n Map state_map = [\n 'down': 0,\n 'up' : 1\n ]\n\n ifResponse?.'data'.each { it ->\n String wildvalue = lmEmit.sanitizeWildvalue(\"${it.'vdevice-dataKey'}\".toString())\n \n lmEmit.dp(wildvalue, \"admin_state\", state_map[it.'admin-state'.toString().toLowerCase()])\n lmEmit.dp(wildvalue, \"operation_state\", state_map[it.'operation-state'.toString().toLowerCase()])\n lmEmit.dp(wildvalue, \"num_vsmarts\", it.'num-vsmarts')\n lmEmit.dp(wildvalue, \"num_vmanages\", it.'num-vmanages')\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "datapoints": [{"name": "admin_state", "description": "Admin state of the interface.\n\nStatus codes:\n0=down,\n1=up", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.admin_state", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "num_vmanages", "description": "Number of associated vManage devices.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.num_vmanages", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "num_vsmarts", "description": "Number of associated vSmart devices.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.num_vsmarts", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operation_state", "description": "Operating state of the interface.\n\nStatus codes:\n0=down,\n1=up", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.operation_state", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Devices", "title": "Devices", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "num_vmanages", "datapointName": "num_vmanages", "consolidationFn": "average"}, {"name": "num_vsmarts", "datapointName": "num_vsmarts", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "vManage", "color": "orange2", "datapointName": "num_vmanages", "isVirtual": false}, {"type": "line", "legend": "vSmart", "color": "silver", "datapointName": "num_vsmarts", "isVirtual": false}]}, {"name": "State", "title": "State", "verticalLabel": "0=down, 1=up", "min": -1.0, "max": 2.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "admin_state", "datapointName": "admin_state", "consolidationFn": "average"}, {"name": "operation_state", "datapointName": "operation_state", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Admin State", "color": "olive", "datapointName": "admin_state", "isVirtual": false}, {"type": "line", "legend": "Operating State", "color": "fuchsia", "datapointName": "operation_state", "isVirtual": false}]}], "overviewGraphs": [{"name": "Admin State Overview", "title": "Admin State Overview", "verticalLabel": "0=down, 1=up", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "admin_state", "datapointName": "admin_state", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "admin_state", "isVirtual": false}]}, {"name": "Operating State Overview", "title": "Operating State Overview", "verticalLabel": "0=down, 1=up", "min": -1.0, "max": 2.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "operation_state", "datapointName": "operation_state", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "operation_state", "isVirtual": false}]}]}

×DataSource: Cisco_vManage_Devices (515)

{"name": "Cisco_vManage_Devices", "description": "Monitors all sites associated to the vManage portal.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "vmanage,devices,cisco", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port", "displayedAs": "Cisco vManage: Devices", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\ndef lmtopo = modLoader.load(\"lm.topo\", \"0\") // Load topo snippet\ndef lmtopoData = modLoader.load(\"lm.data.topo\", \"0\") // Load topo data\nlmtopoData.run()\n\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def devices = snip.getDevice()\n\n if (devices) {\n devices.'data'.each { it ->\n String wildvalue = lmEmit.sanitizeWildvalue(it.'host-name'.toString())\n String wildalias = lmEmit.sanitizeWildalias(it.'host-name'.toString()) // Done separately to preserve history in case of spaces in host-name\n String descr = \"${it.'system-ip'} | Site ID: ${it.'site-id'}\"\n\n // print \"${wildvalue}##${it.'host-name'}##${it.'system-ip'} | Site ID: ${it.'site-id'}####\" +\n Map ilps = [\n \"auto.cisco.vmanage.device.host-name\" : lmEmit.sanitizePropertyValue(it.'host-name'),\n \"auto.cisco.vmanage.device.type\" : lmEmit.sanitizePropertyValue(it.'device-type'),\n \"auto.cisco.vmanage.device.os\" : lmEmit.sanitizePropertyValue(it.'device-os'),\n \"auto.cisco.vmanage.device.model\" : lmEmit.sanitizePropertyValue(it.'device-model'),\n \"auto.cisco.vmanage.device.platform\" : lmEmit.sanitizePropertyValue(it.'platform'),\n \"auto.cisco.vmanage.device.timezone\" : lmEmit.sanitizePropertyValue(it.'timezone'),\n \"auto.cisco.vmanage.device.version\" : lmEmit.sanitizePropertyValue(it.'version'),\n \"auto.cisco.vmanage.device.board-serial\" : lmEmit.sanitizePropertyValue(it.'board-serial'),\n \"auto.cisco.vmanage.device.device-model\" : lmEmit.sanitizePropertyValue(it.'device-model'),\n \"auto.cisco.vmanage.device.connected_vManages\" : lmEmit.sanitizePropertyValue(it.'connectedVManages').replace('\"', ''),\n \"auto.cisco.vmanage.device.site-id\" : lmEmit.sanitizePropertyValue(\"Site ID:${it.'site-id'}\"),\n // Set system ip as ilp for use in script collection API call\n \"auto.cisco.vmanage.device.system-ip\" : lmEmit.sanitizePropertyValue(it.'system-ip'),\n // Set datapoints as ilps in order to avoid other collection api calls\n \"auto.cisco.vmanage.device.status\" : lmEmit.sanitizePropertyValue(it.'status'),\n \"auto.cisco.vmanage.device.state\" : lmEmit.sanitizePropertyValue(it.'state'),\n \"auto.cisco.vmanage.device.reachability\" : lmEmit.sanitizePropertyValue(it.'reachability'),\n \"auto.cisco.vmanage.device.total_cpu_count\" : lmEmit.sanitizePropertyValue(it.'total_cpu_count'), // Not returned in version 17.2.2\n \"auto.cisco.vmanage.device.certificate_validity\" : lmEmit.sanitizePropertyValue(it.'certificate-validity')\n ]\n\n String uuid = it.'uuid'?.toString()\n String deviceHostname = it.'host-name'?.toString()\n if ((uuid || deviceHostname) && it.'device-model' != \"vmanage\") {\n def eris = []\n if (uuid) eris << uuid\n if (deviceHostname) {\n eris << \"cisco-sdwan--${deviceHostname}\"\n } \n ilps[\"predef.externalResourceId\"] = lmtopo.eriPreProcessor(eris, lmtopoData.blockedKeys, keyNamespace, keyBlacklist)\n\n def ert\n def model = it.'device-model'.toString()?.toLowerCase()\n if (model) {\n if (model.contains(\"vedge\")) ert = \"Router\"\n if (model.contains(\"vmanage\")) ert = \"VirtualMachine\"\n if (model.contains(\"vsmart\")) ert = \"VirtualMachine\"\n if (model.contains(\"vbond\")) ert = \"VirtualMachine\"\n if (model.contains(\"vcontainer\")) ert = \"Container\"\n if (ert) ilps[\"predef.externalResourceType\"] = ert\n }\n }\n lmEmit.instance(wildvalue, wildalias, descr, ilps)\n }\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def wildvalue = instanceProps.get(\"wildvalue\")\n def systemIp = instanceProps.get(\"auto.cisco.vmanage.device.system-ip\")\n\n def total_cpu_count = instanceProps.get(\"auto.cisco.vmanage.device.total_cpu_count\") // Not returned in version 17.2.2\n\n def reachability = instanceProps.get(\"auto.cisco.vmanage.device.reachability\")\n Map reachability_map = [\n 'reachable' : '1',\n 'unreachable': '2'\n ]\n\n def validity = instanceProps.get(\"auto.cisco.vmanage.device.certificate_validity\")\n Map validity_map = [\n 'Valid' : '1',\n 'Invalid': '2'\n ]\n\n def status = instanceProps.get(\"auto.cisco.vmanage.device.status\")\n Map status_map = [\n 'normal': '1'\n ]\n\n def state = instanceProps.get(\"auto.cisco.vmanage.device.state\")\n Map state_map = [\n 'gray' : '0',\n 'green' : '1',\n 'yellow': '2',\n 'red' : '3'\n ]\n\n Map enabled_map = [ // Used for disk_status\n 'disabled': '0',\n 'enabled' : '1'\n ]\n\n long now = System.currentTimeMillis()/1000\n\n // These datapoints are from values in ILPs, they will only update when AD runs\n lmEmit.dp(wildvalue, \"status\", status_map[status.toString()])\n lmEmit.dp(wildvalue, \"state\", state_map[state.toString()])\n lmEmit.dp(wildvalue, \"reachability\", reachability_map[reachability.toString()])\n lmEmit.dp(wildvalue, \"total_cpu_count\", total_cpu_count)\n lmEmit.dp(wildvalue, \"certificate_validity\", validity_map[validity.toString()])\n\n // Get live metrics\n def systemStatsResponse = snip.getSystemStats(systemIp)\n\n if (systemStatsResponse) {\n systemStatsResponse.'data'?.each { output ->\n // CPU\n lmEmit.dp(wildvalue, \"cpu_1min_avg\", output?.'min1_avg')\n lmEmit.dp(wildvalue, \"cpu_5min_avg\", output?.'min5_avg')\n lmEmit.dp(wildvalue, \"cpu_15min_avg\", output?.'min15_avg')\n lmEmit.dp(wildvalue, \"cpu_user\", output?.'cpu_user')\n lmEmit.dp(wildvalue, \"cpu_idle\", output?.'cpu_idle')\n lmEmit.dp(wildvalue, \"cpu_system\", output?.'cpu_system')\n\n // Memory\n lmEmit.dp(wildvalue, \"mem_total\", ((output?.'mem_total').toLong() * 1024))\n lmEmit.dp(wildvalue, \"mem_free\", ((output?.'mem_free').toLong() * 1024))\n lmEmit.dp(wildvalue, \"mem_used\", ((output?.'mem_used').toLong() * 1024))\n lmEmit.dp(wildvalue, \"mem_cached\", ((output?.'mem_cached').toLong() * 1024))\n lmEmit.dp(wildvalue, \"mem_buffers\", ((output?.'mem_buffers').toLong() * 1024))\n\n // Disk\n lmEmit.dp(wildvalue, \"disk_avail\", (((output?.'disk_avail').toString().replaceAll('M','')).toLong() * 1024 * 1024))\n lmEmit.dp(wildvalue, \"disk_used\", (((output?.'disk_used').toString().replaceAll('M','')).toLong() * 1024 * 1024))\n lmEmit.dp(wildvalue, \"disk_size\", (((output?.'disk_size').toString().replaceAll('M','')).toLong() * 1024 * 1024))\n lmEmit.dp(wildvalue, \"disk_use\", output?.'disk_use')\n lmEmit.dp(wildvalue, \"disk_status\", enabled_map[output?.'disk_status'.toString()])\n\n // Other\n lmEmit.dp(wildvalue, \"procs\", output?.'procs')\n lmEmit.dp(wildvalue, \"uptime\", (now - (output?.'uptime-date'.toLong()/1000)))\n }\n }\n else {\n snip.LMDebug(\"No system stat results for ${wildvalue} on ${systemIp}\")\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "datapoints": [{"name": "certificate_validity", "description": "Certificate validity state.\n\nStatus codes:\n1=Valid,\n2=Invalid", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.certificate_validity", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpu_15min_avg", "description": "CPU average load over the last 15 minutes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cpu_15min_avg", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpu_1min_avg", "description": "CPU average load over the last 1 minute.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cpu_1min_avg", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpu_5min_avg", "description": "CPU average load over the last 5 minutes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cpu_5min_avg", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpu_idle", "description": "Percent cpu was idle.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cpu_idle", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpu_system", "description": "Percent cpu was busy with system tasks.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cpu_system", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpu_user", "description": "Percent cpu was busy with user tasks.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cpu_user", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "disk_avail", "description": "Available disk space in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.disk_avail", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "disk_size", "description": "Total disk size in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.disk_size", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "disk_status", "description": "Disk operating status.\n\nStatus codes:\n0=disabled,\n1=enabled", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.disk_status", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "disk_use", "description": "Percent of disk utilized.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.disk_use", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "disk_used", "description": "Used disk space in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.disk_used", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mem_buffers", "description": "Buffered memory, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.mem_buffers", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mem_cached", "description": "Cached memory, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.mem_cached", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mem_free", "description": "Memory free, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.mem_free", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mem_total", "description": "Total memory, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.mem_total", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mem_used", "description": "Memory in use, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.mem_used", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "procs", "description": "Number of running processes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.procs", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "reachability", "description": "Reachability status.\n\nStatus codes:\n1=yes, reachable,\n2=not reachable", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.reachability", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "state", "description": "Operating state of the device.\n\nStatus codes:\n0=Gray,\n1=Green,\n2=Yellow,'\n3=Red", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.state", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "= 2 3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Cisco vManage device ##HOSTNAME## is reporting a managed router with memory, hardware, or CPU issues (##LEVEL## alert), having a status code of ##VALUE##:\n\nStatus codes:\n0=Gray,\n1=Green,\n2=Yellow, (Using between 70% and 90% of total memory or total CPU is classified as a warning)\n3=Red (Using more than 90% of total memory or total CPU is classified as an error)\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "status", "description": "Current status of the device.\n\nStatus codes:\n1=normal", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.status", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "total_cpu_count", "description": "CPU count (some older versions do not provide this info).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.total_cpu_count", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "uptime", "description": "System uptime, in seconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.uptime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "CPU Count", "title": "CPU Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 13, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "total_cpu_count", "datapointName": "total_cpu_count", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "CPUs", "color": "black", "datapointName": "total_cpu_count", "isVirtual": false}]}, {"name": "CPU Load Averages", "title": "CPU Load Averages", "verticalLabel": "load", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cpu_15min_avg", "datapointName": "cpu_15min_avg", "consolidationFn": "average"}, {"name": "cpu_1min_avg", "datapointName": "cpu_1min_avg", "consolidationFn": "average"}, {"name": "cpu_5min_avg", "datapointName": "cpu_5min_avg", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "15 min avg.", "color": "fuchsia", "datapointName": "cpu_15min_avg", "isVirtual": false}, {"type": "line", "legend": "1 min avg.", "color": "navy", "datapointName": "cpu_1min_avg", "isVirtual": false}, {"type": "line", "legend": "5 min avg.", "color": "olive", "datapointName": "cpu_5min_avg", "isVirtual": false}]}, {"name": "CPU Usage", "title": "CPU Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cpu_idle", "datapointName": "cpu_idle", "consolidationFn": "average"}, {"name": "cpu_system", "datapointName": "cpu_system", "consolidationFn": "average"}, {"name": "cpu_user", "datapointName": "cpu_user", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Idle", "color": "olive", "datapointName": "cpu_idle", "isVirtual": false}, {"type": "stack", "legend": "System", "color": "orange2", "datapointName": "cpu_system", "isVirtual": false}, {"type": "stack", "legend": "User", "color": "fuchsia", "datapointName": "cpu_user", "isVirtual": false}]}, {"name": "Certificate Validity", "title": "Certificate Validity", "verticalLabel": "1=valid, 2=invalid", "min": 0.0, "max": 3.0, "displayPriority": 11, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "certificate_validity", "datapointName": "certificate_validity", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Validity", "color": "aqua", "datapointName": "certificate_validity", "isVirtual": false}]}, {"name": "Disk Status", "title": "Disk Status", "verticalLabel": "0=disabled, 1=enabled", "min": -1.0, "max": 2.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "disk_status", "datapointName": "disk_status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "green", "datapointName": "disk_status", "isVirtual": false}]}, {"name": "Disk Usage", "title": "Disk Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "disk_avail", "datapointName": "disk_avail", "consolidationFn": "average"}, {"name": "disk_size", "datapointName": "disk_size", "consolidationFn": "average"}, {"name": "disk_used", "datapointName": "disk_used", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Available", "color": "olive", "datapointName": "disk_avail", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "disk_size", "isVirtual": false}, {"type": "stack", "legend": "Used", "color": "fuchsia", "datapointName": "disk_used", "isVirtual": false}]}, {"name": "Disk Utilization", "title": "Disk Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "disk_use", "datapointName": "disk_use", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "disk_use", "color": "blue", "datapointName": "disk_use", "isVirtual": false}]}, {"name": "Memory Usage", "title": "Memory Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "mem_buffers", "datapointName": "mem_buffers", "consolidationFn": "average"}, {"name": "mem_cached", "datapointName": "mem_cached", "consolidationFn": "average"}, {"name": "mem_free", "datapointName": "mem_free", "consolidationFn": "average"}, {"name": "mem_total", "datapointName": "mem_total", "consolidationFn": "average"}, {"name": "mem_used", "datapointName": "mem_used", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Buffers", "color": "navy", "datapointName": "mem_buffers", "isVirtual": false}, {"type": "stack", "legend": "Cached", "color": "fuchsia", "datapointName": "mem_cached", "isVirtual": false}, {"type": "stack", "legend": "Free", "color": "olive", "datapointName": "mem_free", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "mem_total", "isVirtual": false}, {"type": "stack", "legend": "Used", "color": "yellow", "datapointName": "mem_used", "isVirtual": false}]}, {"name": "Processes", "title": "Processes", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "procs", "datapointName": "procs", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Processes", "color": "fuchsia", "datapointName": "procs", "isVirtual": false}]}, {"name": "Reachability", "title": "Reachability", "verticalLabel": "1=yes, 2=no", "min": 0.0, "max": 3.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "reachability", "datapointName": "reachability", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Reachability", "color": "red1", "datapointName": "reachability", "isVirtual": false}]}, {"name": "State", "title": "State", "verticalLabel": "status code", "min": -1.0, "max": 4.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "state", "datapointName": "state", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "State", "color": "silver", "datapointName": "state", "isVirtual": false}]}, {"name": "Status", "title": "Status", "verticalLabel": "1=normal", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "status", "datapointName": "status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "blue", "datapointName": "status", "isVirtual": false}]}, {"name": "Uptime", "title": "Uptime", "verticalLabel": "days", "min": 0.0, "displayPriority": 12, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "uptime", "datapointName": "uptime", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "uptime_days", "expr": "uptime/60/60/24"}], "lines": [{"type": "line", "legend": "Uptime (in days)", "color": "silver", "datapointName": "uptime_days", "isVirtual": true}]}], "overviewGraphs": [{"name": "Top 10 Devices by CPU Load (1min Average)", "title": "Top 10 Devices by CPU Load (1min Average)", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "cpu_1min_avg", "datapointName": "cpu_1min_avg", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "cpu_1min_avg", "isVirtual": false}]}, {"name": "Top 10 Devices by Disk Utilization", "title": "Top 10 Devices by Disk Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "disk_use", "datapointName": "disk_use", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "disk_use", "isVirtual": false}]}, {"name": "Top 10 Devices by Number of Processes", "title": "Top 10 Devices by Number of Processes", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "procs", "datapointName": "procs", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "procs", "isVirtual": false}]}]}

×DataSource: Cisco_vManage_IPv4Interfaces (523)

{"name": "Cisco_vManage_IPv4Interfaces", "description": "Display information about IPv4 interfaces.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "sdwan,vmanage,networking,cisco,viptela", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port\n\n- https://sdwan-docs.cisco.com/Product_Documentation/Command_Reference/Command_Reference/vManage_REST_APIs/Bulk_APIs/State#Interface", "displayedAs": "Cisco vManage: IPv4 Interfaces", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def ifResponse = snip.getIf()\n\n ifResponse?.'data'.each { it ->\n String wildvalue = lmEmit.sanitizeWildvalue(it.'vdevice-dataKey')\n String descr = \"${it.'vdevice-host-name'} || Type: ${it.'port-type'}\"\n Map ilps = [\n \"auto.cisco.vmanage.interface.hardware_address\" : it.'hwaddr',\n \"auto.cisco.vmanage.interface.port_type\" : it.'port-type'\n ]\n lmEmit.instance(wildvalue, wildvalue, descr, ilps)\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "groupMethod": "ilp", "groupExpr": "auto.cisco.vmanage.interface.port_type"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def ifResponse = snip.getIf()\n\n Map status_map = [\n 'Down': 0,\n 'Up' : 1\n ]\n\n ifResponse?.'data'.each { it ->\n String wildvalue = lmEmit.sanitizeWildvalue(it.'vdevice-dataKey')\n\n lmEmit.dp(wildvalue, \"if_admin_status\", status_map[it.'if-admin-status'])\n lmEmit.dp(wildvalue, \"if_oper_status\", status_map[it.'if-oper-status'])\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "datapoints": [{"name": "if_admin_status", "description": "Administrative status of the interface.\n\nStatus codes:\n0=down,\n1=up", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.if_admin_status", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "if_oper_status", "description": "Operating status of the interface.\n\nStatus codes:\n0=down,\n1=up", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.if_oper_status", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Status", "title": "Status", "verticalLabel": "0=down, 1=up", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "if_admin_status", "datapointName": "if_admin_status", "consolidationFn": "average"}, {"name": "if_oper_status", "datapointName": "if_oper_status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Admin Status", "color": "green", "datapointName": "if_admin_status", "isVirtual": false}, {"type": "line", "legend": "Operating Status", "color": "fuchsia", "datapointName": "if_oper_status", "isVirtual": false}]}], "overviewGraphs": [{"name": "Admin Status Overview", "title": "Admin Status Overview", "verticalLabel": "0=down, 1=up", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "if_admin_status", "datapointName": "if_admin_status", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "if_admin_status", "isVirtual": false}]}, {"name": "Operating Status Overview", "title": "Operating Status Overview", "verticalLabel": "0=down, 1=up", "min": -1.0, "max": 2.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "if_oper_status", "datapointName": "if_oper_status", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "if_oper_status", "isVirtual": false}]}]}

×DataSource: Cisco_vManage_OMP (522)

{"name": "Cisco_vManage_OMP", "description": "Monitors vManage device OMP (Overlay Management Protocol) metrics.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "vmanage,omp,cisco", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port\n\n- https://sdwan-docs.cisco.com/Product_Documentation/Command_Reference/Command_Reference/vManage_REST_APIs/Real-Time_Monitoring_APIs/OMP", "displayedAs": "Cisco vManage: OMP", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def deviceResponse = snip.getDevice()\n\n deviceResponse?.'data'.each { it ->\n // Only vSmart & vEdge devices support for OMP metrics\n if (((it.'device-type'.toString() == 'vsmart') || (it.'device-type'.toString() == 'vedge'))) {\n String wildvalue = lmEmit.sanitizeWildvalue(it.'host-name')\n String wildalias = lmEmit.sanitizeWildalias(it.'host-name') // wa sanitized differently than wv\n String descr = \"${it.'system-ip'} | Site ID: ${it.'site-id'}\"\n // Set system ip as ILP for use in script collection API call\n Map ilps = [\n \"auto.cisco.vmanage.device.system-ip\" : it.'system-ip',\n \"auto.cisco.vmanage.device.type\" : it.'device-type'\n ]\n lmEmit.instance(wildvalue, wildalias, descr, ilps)\n }\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def wildvalue = instanceProps.get(\"wildvalue\")\n def systemIp = instanceProps.get(\"auto.cisco.vmanage.device.system-ip\")\n\n Map state_map = [\n 'UP': '1',\n 'DOWN': '2'\n ]\n List ignoredFields = [\n \"vdevice-host-name\", \"vdevice-name\", \"vdevice-dataKey\", \"devicetype\"\n ]\n\n def OMPResponse = snip.getOMPDevice(systemIp)\n\n if (OMPResponse) {\n OMPResponse.'data'?.each { output ->\n output.each { k, v ->\n if ((k == 'adminstate' || k == 'operstate')) {\n // Use state map to lookup numeric value\n lmEmit.dp(wildvalue, k.replaceAll('-', '_'), state_map[v.toString()])\n }\n else if (ignoredFields.contains(k)) {\n return\n }\n else {\n lmEmit.dp(wildvalue, k.replaceAll('-', '_'), v)\n }\n }\n }\n }\n else {\n println \"Failed to find results for this instance. Try debug mode.\"\n snip.LMDebug(\"No results for ${wildvalue} on ${systemIp}\")\n return 1\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "datapoints": [{"name": "adminstate", "description": "OMP admin state.\n\nStatus codes:\n1=up,\n2=down", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.adminstate", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "alert_received", "description": "Number of alerts received per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.alert_received", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "alert_sent", "description": "Number of alerts sent per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.alert_sent", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "handshake_received", "description": "Number of handshakes received per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.handshake_received", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "handshake_sent", "description": "Number of handshakes sent per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.handshake_sent", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "hello_received", "description": "Number of hello's received per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.hello_received", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "hello_sent", "description": "Number of hello's sent per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.hello_sent", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "inform_received", "description": "Number of inform's received per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.inform_received", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "inform_sent", "description": "Number of inform's sent per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.inform_sent", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mcast_routes_installed", "description": "Number of multicast routes installed", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.mcast_routes_installed", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mcast_routes_received", "description": "Number of multicast routes received", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.mcast_routes_received", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mcast_routes_sent", "description": "Number of multicast routes sent.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.mcast_routes_sent", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operstate", "description": "OMP operating state.\n\nStatus codes:\n1=up,\n2=down", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.operstate", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "packets_received", "description": "Number of packets received per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.packets_received", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "packets_sent", "description": "Number of packets sent per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.packets_sent", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "policy_received", "description": "Number of policies received per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.policy_received", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "policy_sent", "description": "Number of policies sent per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.policy_sent", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "routes_installed", "description": "Number of routes installed.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.routes_installed", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "routes_received", "description": "Number of routes received.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.routes_received", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "routes_sent", "description": "Number of routes sent.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.routes_sent", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "services_installed", "description": "Number of services installed.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.services_installed", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "services_received", "description": "Number of services received.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.services_received", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "services_sent", "description": "Number of services sent.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.services_sent", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "tlocs_installed", "description": "Number of TLOCs installed.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.tlocs_installed", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "tlocs_received", "description": "Number of TLOCs received.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.tlocs_received", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "tlocs_sent", "description": "Number of TLOCs sent.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.tlocs_sent", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "update_received", "description": "Number of updates received per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.update_received", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "update_sent", "description": "Number of updates sent per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.update_sent", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "vsmart_peers", "description": "Number of vSmart peers.", "interpretMethod": "namevalue", "interpretExpr": "##WILDALIAS##.vsmart_peers", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Packet Details", "title": "Packet Details", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "alert_received", "datapointName": "alert_received", "consolidationFn": "average"}, {"name": "alert_sent", "datapointName": "alert_sent", "consolidationFn": "average"}, {"name": "handshake_received", "datapointName": "handshake_received", "consolidationFn": "average"}, {"name": "handshake_sent", "datapointName": "handshake_sent", "consolidationFn": "average"}, {"name": "hello_received", "datapointName": "hello_received", "consolidationFn": "average"}, {"name": "hello_sent", "datapointName": "hello_sent", "consolidationFn": "average"}, {"name": "inform_received", "datapointName": "inform_received", "consolidationFn": "average"}, {"name": "inform_sent", "datapointName": "inform_sent", "consolidationFn": "average"}, {"name": "policy_received", "datapointName": "policy_received", "consolidationFn": "average"}, {"name": "policy_sent", "datapointName": "policy_sent", "consolidationFn": "average"}, {"name": "update_received", "datapointName": "update_received", "consolidationFn": "average"}, {"name": "update_sent", "datapointName": "update_sent", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Alert Received", "color": "blue", "datapointName": "alert_received", "isVirtual": false}, {"type": "stack", "legend": "Alert Sent", "color": "aqua", "datapointName": "alert_sent", "isVirtual": false}, {"type": "stack", "legend": "Handshake Received", "color": "silver", "datapointName": "handshake_received", "isVirtual": false}, {"type": "stack", "legend": "Handshake Sent", "color": "green", "datapointName": "handshake_sent", "isVirtual": false}, {"type": "stack", "legend": "Hello Received", "color": "olive", "datapointName": "hello_received", "isVirtual": false}, {"type": "stack", "legend": "Hello Sent", "color": "red1", "datapointName": "hello_sent", "isVirtual": false}, {"type": "stack", "legend": "Inform Received", "color": "red", "datapointName": "inform_received", "isVirtual": false}, {"type": "stack", "legend": "Inform Sent", "color": "orange2", "datapointName": "inform_sent", "isVirtual": false}, {"type": "stack", "legend": "Policy Received", "color": "yellow", "datapointName": "policy_received", "isVirtual": false}, {"type": "stack", "legend": "Policy Sent", "color": "maroon", "datapointName": "policy_sent", "isVirtual": false}, {"type": "stack", "legend": "Update Received", "color": "fuchsia", "datapointName": "update_received", "isVirtual": false}, {"type": "stack", "legend": "Update Sent", "color": "gray", "datapointName": "update_sent", "isVirtual": false}]}, {"name": "Packet Transmission", "title": "Packet Transmission", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "packets_received", "datapointName": "packets_received", "consolidationFn": "average"}, {"name": "packets_sent", "datapointName": "packets_sent", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "blue", "datapointName": "packets_received", "isVirtual": false}, {"type": "stack", "legend": "Sent", "color": "olive", "datapointName": "packets_sent", "isVirtual": false}]}, {"name": "Routes", "title": "Routes", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "mcast_routes_installed", "datapointName": "mcast_routes_installed", "consolidationFn": "average"}, {"name": "mcast_routes_received", "datapointName": "mcast_routes_received", "consolidationFn": "average"}, {"name": "mcast_routes_sent", "datapointName": "mcast_routes_sent", "consolidationFn": "average"}, {"name": "routes_installed", "datapointName": "routes_installed", "consolidationFn": "average"}, {"name": "routes_received", "datapointName": "routes_received", "consolidationFn": "average"}, {"name": "routes_sent", "datapointName": "routes_sent", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Multicast Routes Installed", "color": "teal", "datapointName": "mcast_routes_installed", "isVirtual": false}, {"type": "line", "legend": "Multicast Routes Received", "color": "silver", "datapointName": "mcast_routes_received", "isVirtual": false}, {"type": "line", "legend": "Multicast Routes Sent", "color": "green", "datapointName": "mcast_routes_sent", "isVirtual": false}, {"type": "line", "legend": "Routes Installed", "color": "red1", "datapointName": "routes_installed", "isVirtual": false}, {"type": "line", "legend": "Routes Received", "color": "yellow", "datapointName": "routes_received", "isVirtual": false}, {"type": "line", "legend": "Routes Sent", "color": "fuchsia", "datapointName": "routes_sent", "isVirtual": false}]}, {"name": "Services", "title": "Services", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "services_installed", "datapointName": "services_installed", "consolidationFn": "average"}, {"name": "services_received", "datapointName": "services_received", "consolidationFn": "average"}, {"name": "services_sent", "datapointName": "services_sent", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Installed", "color": "black", "datapointName": "services_installed", "isVirtual": false}, {"type": "line", "legend": "Received", "color": "navy", "datapointName": "services_received", "isVirtual": false}, {"type": "line", "legend": "Sent", "color": "fuchsia", "datapointName": "services_sent", "isVirtual": false}]}, {"name": "State", "title": "State", "verticalLabel": "1=up, 2=down", "min": 0.0, "max": 3.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "adminstate", "datapointName": "adminstate", "consolidationFn": "average"}, {"name": "operstate", "datapointName": "operstate", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Admin State", "color": "silver", "datapointName": "adminstate", "isVirtual": false}, {"type": "line", "legend": "Operating State", "color": "fuchsia", "datapointName": "operstate", "isVirtual": false}]}, {"name": "TLOCs", "title": "TLOCs", "verticalLabel": "count", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "tlocs_installed", "datapointName": "tlocs_installed", "consolidationFn": "average"}, {"name": "tlocs_received", "datapointName": "tlocs_received", "consolidationFn": "average"}, {"name": "tlocs_sent", "datapointName": "tlocs_sent", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Installed", "color": "red1", "datapointName": "tlocs_installed", "isVirtual": false}, {"type": "line", "legend": "Received", "color": "fuchsia", "datapointName": "tlocs_received", "isVirtual": false}, {"type": "line", "legend": "Sent", "color": "aqua", "datapointName": "tlocs_sent", "isVirtual": false}]}, {"name": "vSmart Peers", "title": "vSmart Peers", "verticalLabel": "count", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "vsmart_peers", "datapointName": "vsmart_peers", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "vSmart Peers", "color": "gray", "datapointName": "vsmart_peers", "isVirtual": false}]}], "overviewGraphs": [{"name": "Admin State Overview", "title": "Admin State Overview", "verticalLabel": "1=up, 2=down", "min": 0.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "adminstate", "datapointName": "adminstate", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "adminstate", "isVirtual": false}]}, {"name": "Operating State Overview", "title": "Operating State Overview", "verticalLabel": "1=up, 2=down", "min": 0.0, "max": 3.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "operstate", "datapointName": "operstate", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "operstate", "isVirtual": false}]}, {"name": "Top 10 Devices by Total Packet Transmission", "title": "Top 10 Devices by Total Packet Transmission", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "packets_received", "datapointName": "packets_received", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "packets_sent", "datapointName": "packets_sent", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "Total", "expr": "packets_received+packets_sent"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "Total", "isVirtual": true}]}]}

×DataSource: Cisco_vManage_OMPPeers (521)

{"name": "Cisco_vManage_OMPPeers", "description": "Display information about active OMP peering sessions.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "sdwan,vmanage,networking,cisco,viptela", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port\n\n- https://sdwan-docs.cisco.com/Product_Documentation/Command_Reference/Command_Reference/vManage_REST_APIs/Bulk_APIs/State", "displayedAs": "Cisco vManage: OMP Peers", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def peersResponse = snip.getOMPPeers()\n\n peersResponse?.'data'?.each { it ->\n String wildvalue = lmEmit.sanitizeWildvalue(it.'vdevice-dataKey')\n String descr = \"${it.'vdevice-host-name'} || Site ID: ${it.'site-id'}\"\n lmEmit.instance(wildvalue, wildvalue, descr)\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def peersResponse = snip.getOMPPeers()\n\n Map state_map = [\n 'down': 0,\n 'up' : 1\n ]\n \n peersResponse?.'data'?.each { it ->\n String wildvalue = lmEmit.sanitizeWildvalue(it.'vdevice-dataKey')\n \n lmEmit.dp(wildvalue, \"state\", state_map[it.'state'.toString().toLowerCase()])\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "datapoints": [{"name": "state", "description": "State of the OMP peer relationship.\n\nStatus codes:\n0=down,\n1=up", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.state", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "State", "title": "State", "verticalLabel": "0=down, 1=up", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "state", "datapointName": "state", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "State", "color": "gray", "datapointName": "state", "isVirtual": false}]}], "overviewGraphs": [{"name": "State Overview", "title": "State Overview", "verticalLabel": "0=down, 1=up", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "state", "datapointName": "state", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "state", "isVirtual": false}]}]}

×DataSource: Cisco_vManage_Sites (519)

{"name": "Cisco_vManage_Sites", "description": "Monitors all sites associated to the vManage portal.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "vmanage,sites,cisco", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port", "displayedAs": "Cisco vManage: Sites", "collectionInterval": "4m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\ndef lmtopo = modLoader.load(\"lm.topo\", \"0\") // Load topo snippet\ndef lmtopoData = modLoader.load(\"lm.data.topo\", \"0\") // Load topo data\nlmtopoData.run()\n\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def deviceResponse = snip.getDevice()\n \n if (deviceResponse) {\n def vManageEri\n def found = false\n deviceResponse.'data'.each { it ->\n if (found) return\n def uuid = it.'uuid'?.toString()\n def ip = it.'system-ip'?.toString()\n def connectedVManages = it.'connectedVManages'?.toString()\n if (uuid && ip && connectedVManages && connectedVManages.contains(ip)) {\n vManageEri = uuid\n found = true\n }\n }\n\n def siteIdsDevicesMap = [:]\n deviceResponse.'data'.collect { it ->\n if (it.'site-id' && it.'system-ip') {\n if (siteIdsDevicesMap.containsKey(it.'site-id')) {\n siteIdsDevicesMap[it.'site-id'] << it.'system-ip'\n }\n else {\n siteIdsDevicesMap.put(it.'site-id', [it.'system-ip'])\n }\n }\n }\n siteIdsDevicesMap.each { siteId, siteDevices ->\n def siteEri = \"cisco-sdwan--site--${vManageEri}--${siteId}\"\n String wildvalue = lmEmit.sanitizeWildvalue(siteEri)\n String descr = \"\"\n Map ilps = [\n \"predef.externalResourceId\" : lmtopo.eriPreProcessor([siteEri], lmtopoData.blockedKeys, keyNamespace, keyBlacklist),\n \"predef.externalResourceType\" : \"Cluster\",\n \"auto.cisco.vmanage.site.devices\" : lmEmit.sanitizePropertyValue(siteDevices)\n ]\n lmEmit.instance(wildvalue, \"Site: ${siteId}\", ilps)\n }\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def wildvalue = instanceProps.get(\"wildvalue\")\n def devices = instanceProps.get(\"auto.cisco.vmanage.site.devices\").tokenize(\",\")\n\n // Init site metric map\n HashMap<String, Long> siteData = new HashMap<String, Long>()\n\n // Memory\n siteData[\"${wildvalue}.mem_total\"] = 0\n siteData[\"${wildvalue}.mem_free\"] = 0\n siteData[\"${wildvalue}.mem_used\"] = 0\n siteData[\"${wildvalue}.mem_cached\"] = 0\n siteData[\"${wildvalue}.mem_buffers\"] = 0\n\n // Disk\n siteData[\"${wildvalue}.disk_avail\"] = 0\n siteData[\"${wildvalue}.disk_used\"] = 0\n siteData[\"${wildvalue}.disk_size\"] = 0\n\n // Other\n siteData[\"${wildvalue}.procs\"] = 0\n\n // Aggregate site metrics across devices\n devices.each { deviceId ->\n def systemStats = snip.getDeviceInfo(deviceId)\n\n if (systemStats) {\n systemStats.'data'?.each { output ->\n // Memory\n siteData[\"${wildvalue}.mem_total\"] += output?.'mem_total'.toLong() * 1024\n siteData[\"${wildvalue}.mem_free\"] += output?.'mem_free'.toLong() * 1024\n siteData[\"${wildvalue}.mem_used\"] += output?.'mem_used'.toLong() * 1024\n siteData[\"${wildvalue}.mem_cached\"] += output?.'mem_cached'.toLong() * 1024\n siteData[\"${wildvalue}.mem_buffers\"] += output?.'mem_buffers'.toLong() * 1024\n\n // Disk\n siteData[\"${wildvalue}.disk_avail\"] += output?.'disk_avail'.toString().replaceAll('M', '').toLong() * 1024 * 1024\n siteData[\"${wildvalue}.disk_used\"] += output?.'disk_used'.toString().replaceAll('M', '').toLong() * 1024 * 1024\n siteData[\"${wildvalue}.disk_size\"] += output?.'disk_size'.toString().replaceAll('M', '').toLong() * 1024 * 1024\n\n // Other\n siteData[\"${wildvalue}.procs\"] += output?.'procs'.toLong()\n }\n }\n else {\n snip.LMDebug(\"No system stats for ${deviceId} (wildvalue: ${wildvalue} has ${devices.count()} devices total)\")\n }\n }\n\n // Output site metrics\n siteData.each { metric, data ->\n lmEmit.dp(metric, data)\n }\n} \nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "datapoints": [{"name": "diskUtilization", "description": "Percentage of disk storage in use.", "interpretMethod": "expression", "interpretExpr": "(disk_used/disk_size)*100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "disk_avail", "description": "Available disk space in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.disk_avail", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "disk_size", "description": "Total disk size in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.disk_size", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "disk_used", "description": "Used disk space in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.disk_used", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mem_buffers", "description": "Buffered memory, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.mem_buffers", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mem_cached", "description": "Cached memory, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.mem_cached", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mem_free", "description": "Memory free, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.mem_free", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mem_total", "description": "Total memory, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.mem_total", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "mem_used", "description": "Memory in use, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.mem_used", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryUtilization", "description": "Percentage of system memory in use.", "interpretMethod": "expression", "interpretExpr": "(mem_used/mem_total)*100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "procs", "description": "Number of running processes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.procs", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Disk Usage", "title": "Disk Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "disk_avail", "datapointName": "disk_avail", "consolidationFn": "average"}, {"name": "disk_size", "datapointName": "disk_size", "consolidationFn": "average"}, {"name": "disk_used", "datapointName": "disk_used", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Available", "color": "olive", "datapointName": "disk_avail", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "disk_size", "isVirtual": false}, {"type": "stack", "legend": "Used", "color": "fuchsia", "datapointName": "disk_used", "isVirtual": false}]}, {"name": "Memory Usage", "title": "Memory Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "mem_buffers", "datapointName": "mem_buffers", "consolidationFn": "average"}, {"name": "mem_cached", "datapointName": "mem_cached", "consolidationFn": "average"}, {"name": "mem_free", "datapointName": "mem_free", "consolidationFn": "average"}, {"name": "mem_total", "datapointName": "mem_total", "consolidationFn": "average"}, {"name": "mem_used", "datapointName": "mem_used", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Buffers", "color": "navy", "datapointName": "mem_buffers", "isVirtual": false}, {"type": "stack", "legend": "Cached", "color": "fuchsia", "datapointName": "mem_cached", "isVirtual": false}, {"type": "stack", "legend": "Free", "color": "olive", "datapointName": "mem_free", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "mem_total", "isVirtual": false}, {"type": "stack", "legend": "Used", "color": "yellow", "datapointName": "mem_used", "isVirtual": false}]}, {"name": "Processes", "title": "Processes", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "procs", "datapointName": "procs", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Processes", "color": "fuchsia", "datapointName": "procs", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Sites by Disk Utilization", "title": "Top 10 Sites by Disk Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "diskUtilization", "datapointName": "diskUtilization", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "diskUtilization", "isVirtual": false}]}, {"name": "Top 10 Sites by Memory Utilization", "title": "Top 10 Sites by Memory Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "memoryUtilization", "datapointName": "memoryUtilization", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "memoryUtilization", "isVirtual": false}]}]}

×DataSource: Cisco_vManage_TransportHealth (518)

{"name": "Cisco_vManage_TransportHealth", "description": "Monitors vManage overall transport performance metrics such as jitter, loss and latency.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "sdwan,vmanage,networking,cisco,viptela", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port", "displayedAs": "Cisco vManage: Transport Health", "collectionInterval": "4m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def latencyResponse = snip.getLatency()\n\n latencyResponse?.'data'.each { it ->\n // Only create instances for responses with a value present for \"color\"\n if (it.color) {\n wildvalue = lmEmit.sanitizeWildvalue(it.'color')\n lmEmit.instance(wildvalue, it.'color')\n }\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def latencyResponse = snip.getLatency()\n\n latencyResponse?.'data'?.each { it ->\n // Only gather data for responses with a value present for \"color\"\n if (it.color) {\n wildvalue = lmEmit.sanitizeWildvalue(it.'color')\n \n lmEmit.dp(wildvalue, \"jitter\", it.'jitter')\n lmEmit.dp(wildvalue, \"loss_percentage\", it.'loss_percentage')\n lmEmit.dp(wildvalue, \"latency\", it.'latency')\n }\n else {\n snip.LMDebugLog(\"No \\\"color\\\" present, skipping data\")\n }\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "datapoints": [{"name": "jitter", "description": "Last measured jitter, in milliseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.jitter", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "latency", "description": "Last measured latency, in milliseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.latency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "loss_percentage", "description": "Last measured loss, in percent.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.loss_percentage", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Jitter", "title": "Jitter", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "jitter", "datapointName": "jitter", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Jitter", "color": "silver", "datapointName": "jitter", "isVirtual": false}]}, {"name": "Latency", "title": "Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "latency", "datapointName": "latency", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Latency", "color": "green", "datapointName": "latency", "isVirtual": false}]}, {"name": "Loss", "title": "Loss", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "loss_percentage", "datapointName": "loss_percentage", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Percent Loss", "color": "fuchsia", "datapointName": "loss_percentage", "isVirtual": false}]}], "overviewGraphs": [{"name": "Jitter Overview", "title": "Jitter Overview", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "jitter", "datapointName": "jitter", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "jitter", "isVirtual": false}]}, {"name": "Latency Overview", "title": "Latency Overview", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "latency", "datapointName": "latency", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "latency", "isVirtual": false}]}, {"name": "Loss Overview", "title": "Loss Overview", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "loss_percentage", "datapointName": "loss_percentage", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "loss_percentage", "isVirtual": false}]}]}

×DataSource: Cisco_vManage_WANEdgeInventory (517)

{"name": "Cisco_vManage_WANEdgeInventory", "description": "Monitors the WAN edge inventory of devices and their validity and deployed/staging state.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "sdwan,vmanage,networking,cisco,viptela", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port", "displayedAs": "Cisco vManage: WAN Edge Inventory", "collectionInterval": "15m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def edgeResponse = snip.getEdge()\n\n edgeResponse?.'data'.each { it ->\n String wildvalue = lmEmit.sanitizeWildvalue(it.'chasisNumber')\n String description = \"${it.'serialNumber'}\"\n if (it.'host-name') {\n description = \"${it.'host-name'} (${it.'system-ip'}) Site ID: ${it.'site-id'}| ${it.'serialNumber'}\"\n }\n lmEmit.instance(wildvalue, wildvalue, description)\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n def edgeResponse = snip.getEdge()\n\n edgeResponse?.'data'.each { it ->\n String wildvalue = lmEmit.sanitizeWildvalue(it.'chasisNumber')\n \n lmEmit.dp(wildvalue, \"validity\", ((it.'validity' == 'valid') ? 1 : 0))\n lmEmit.dp(wildvalue, \"deployed\", ((it.'site-id' && it.'system-ip') ? 1 : 0))\n }\n}\nelse {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n}\n\nreturn 0"}, "datapoints": [{"name": "deployed", "description": "Deployed status of the device.\n\n0=undeployed,\n1=deployed", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.deployed", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "validity", "description": "Validity status of the device.\n\n0=invalid,\n1=valid", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.validity", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Deployed Status", "title": "Deployed Status", "verticalLabel": "0=undeployed, 1=deployed", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "deployed", "datapointName": "deployed", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Deployed Status", "color": "fuchsia", "datapointName": "deployed", "isVirtual": false}]}, {"name": "Validity", "title": "Validity", "verticalLabel": "0=invalid, 1=valid", "min": -1.0, "max": 2.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "validity", "datapointName": "validity", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Validity Status", "color": "silver", "datapointName": "validity", "isVirtual": false}]}], "overviewGraphs": [{"name": "Deployed Overview", "title": "Deployed Overview", "verticalLabel": "1=deployed", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "deployed", "datapointName": "deployed", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "deployed", "isVirtual": false}]}]}

×DataSource: Cisco_Wireless_AP (110)

{"name": "Cisco_Wireless_AP", "description": "Monitors Cisco wireless access point admin and operating status.", "appliesTo": "system.sysinfo =~ \"Cisco Controller\" || (system.sysinfo =~ \"Cisco\" && system.sysinfo =~ \"C9800\")", "searchKeywords": "wireless,cisco,wlc,switch", "technicalNotes": "- supports toplogies.", "displayedAs": "Cisco Wireless: Access Points", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\n\ndef modLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\ndef emit = modLoader.load(\"lm.emit\", \"0\") // Streamlines emitting data into LM\n\ndef hostName = hostProps.get(\"system.hostname\")\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\ndef timeout = 90000\n\ndef stations = Snmp.walkAsMap(hostName, \"1.3.6.1.4.1.14179.2.2.1.1.3\", null, timeout)\ndef description = Snmp.walkAsMap(hostName, \"1.3.6.1.4.1.14179.2.2.1.1.4\", null, timeout)\ndef apMac = Snmp.walkAsMap(hostName, \"1.3.6.1.4.1.14179.2.2.1.1.33\", null, timeout)\ndef model = Snmp.walkAsMap(hostName, \"1.3.6.1.4.1.14179.2.2.1.1.16\", null, timeout)\ndef serial_no = Snmp.walkAsMap(hostName, \"1.3.6.1.4.1.14179.2.2.1.1.17\", null, timeout)\ndef ipAddress = Snmp.walkAsMap(hostName, \"1.3.6.1.4.1.14179.2.2.1.1.19\", null, timeout)\n\nstations.each { accessPointLeaf, accessPointName ->\n def showDescription = description[accessPointLeaf]\n def wildValue = accessPointLeaf.replace(\".\", \"_\")\n def props = [:]\n \n props[\"predef.externalResourceType\"] = \"AccessPoint\"\n props[\"model\"] = model[accessPointLeaf] ?: null\n props[\"serial_no\"] = serial_no[accessPointLeaf] ?: null\n props[\"ip.address\"] = ipAddress[accessPointLeaf] ?: null\n props[\"description\"] = showDescription ?: null // might be used in reports or dashboards, kept for compatibility, legacy module had this ILP even though we are setting an instance description as well. \n def lookupApMac = apMac[accessPointLeaf]\n // test for data stored in the mac apMac OID that breaks collection, needed since some resources store Lq followed by binary data in the mac address oid. \n if (!(lookupApMac =~ /^Lq/) ){\n props[\"macaddress\"] = lookupApMac\n if (isMac(lookupApMac, [])) {\n def apEri = []\n apEri << lookupApMac\n props[\"predef.externalResourceId\"] = eriPreProcessor(apEri, keyNamespace, keyBlacklist)\n emit.instance(\"${wildValue}\",\"${accessPointName}\",\"${showDescription}\",props)\n }\n }\n}\n\nreturn 0\n\n/**\n * Function to validate a MAC address and filter it out if reserved\n * @param address\n * @param reservedAddresses\n * @return boolean\n */\ndef isMac(address, reservedAddresses) {\n if (address == null) return false\n \n else {\n \n if (address.toString().toLowerCase().matches(\"[0-9a-f]{2}([-:]?)[0-9a-f]{2}(\\\\1[0-9a-f]{2}){4}\\$\")) {\n if (!reservedAddresses.find { address.startsWith(it) }) return true\n }\n return false\n }\n}\n\n/**\n *\n * @param eriList\n * @param namespace\n * @param blacklist\n * @return\n */\ndef eriPreProcessor(List eriList, String namespace, List blacklist) {\n def output = []\n eriList.each { eri ->\n eri = eri.toLowerCase()\n eri = eri.replace(\",\", \"_\")\n if (!blacklist.contains(eri)) {\n if (namespace) {\n namespace = namespace.replace(\",\", \"_\").replace(\"&\", \"and\")\n eri = \"${namespace}::${eri}\"\n }\n output << eri\n }\n }\n return output.join(\",\")\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\nhost = hostProps.get(\"system.hostname\")\n\ndef timeout = 90000\n\ndef bsnAPOperationStatus = Snmp.walkAsMap(host, \".1.3.6.1.4.1.14179.2.2.1.1.6\", null, timeout)\ndef bsnAPAdminStatus = Snmp.walkAsMap(host, \".1.3.6.1.4.1.14179.2.2.1.1.37\", null, timeout)\n\nbsnAPAdminStatus.each { apIndex, adminStatus ->\n def operatingStatus = bsnAPOperationStatus[apIndex]\n\n def wildValue = apIndex.replace(\".\", \"_\")\n\n println \"${wildValue}.bsnAPAdminStatus=${adminStatus}\"\n println \"${wildValue}.bsnAPOperationStatus=${operatingStatus}\"\n}\n\nreturn 0"}, "datapoints": [{"name": "AdminStatusDisabled", "description": "Complex datapoint to identify only admin disabled access points with a value of 1.", "interpretMethod": "expression", "interpretExpr": "if(eq(bsnAPAdminStatus,2),1,0)", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "AdminStatusEnabled", "description": "Complex datapoint to identify only admin enabled access points with a value of 1.", "interpretMethod": "expression", "interpretExpr": "if(eq(bsnAPAdminStatus,1),1,0)", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OperationStatusDisassociated", "description": "Complex datapoint to identify access points which are in disassociated operating status.", "interpretMethod": "expression", "interpretExpr": "if(eq(bsnAPOperationStatus,2),1,0)", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "bsnAPAdminStatus", "description": "Admin state of the AP.\n\nStatus codes:\n1=enabled,\n2=disabled", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.bsnAPAdminStatus", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "bsnAPOperationStatus", "description": "Operation State of the AP. \n\nStatus codes:\n1=associated,\n2=disassociated,\n3=downloading", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.bsnAPOperationStatus", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Admin Status", "title": "Admin Status", "verticalLabel": "1=enabled, 2=disabled", "min": 0.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "bsnAPAdminStatus", "datapointName": "bsnAPAdminStatus", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Admin Status", "color": "navy", "datapointName": "bsnAPAdminStatus", "isVirtual": false}]}, {"name": "Operating Status", "title": "Operating Status", "verticalLabel": "status code", "min": 0.0, "max": 4.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "bsnAPOperationStatus", "datapointName": "bsnAPOperationStatus", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Operation Status", "color": "black", "datapointName": "bsnAPOperationStatus", "isVirtual": false}]}], "overviewGraphs": [{"name": "Dissociated Access Points Overview", "title": "Dissociated Access Points Overview", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "OperationStatusDisassociated", "datapointName": "OperationStatusDisassociated", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "OperationStatusDisassociated", "isVirtual": false}]}, {"name": "Enabled / Disabled Access Points", "title": "Enabled / Disabled Access Points", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": true, "scale1024": false, "rigid": false, "datapoints": [{"name": "AdminStatusDisabled", "datapointName": "AdminStatusDisabled", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "AdminStatusEnabled", "datapointName": "AdminStatusEnabled", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "Disabled", "color": "orange", "datapointName": "AdminStatusDisabled", "isVirtual": false}, {"type": "stack", "legend": "Enabled", "color": "blue", "datapointName": "AdminStatusEnabled", "isVirtual": false}]}]}

×DataSource: Cisco_UCS_PSUs (203)

{"name": "Cisco_UCS_PSUs", "description": "Monitors PSU performance metrics for Cisco UCS hardware.", "appliesTo": "hasCategory(\"CiscoUCSManager\") || hasCategory(\"CiscoIMC\")", "searchKeywords": "cimc,psu,ucs,cisco,ucsm,unified computing system,power supply", "technicalNotes": "These modules require a minimum collector version (30.000) and additional collector configurations. Review support doc for details: https://www.logicmonitor.com/support/monitoring/networking-firewalls/cisco-ucs-monitoring\nRequires the following host properties:\n- ucs_api.mgmt_host\n- ucs_api.user\n- ucs_api.pass\n\nNOTE: The following datapoints are not available for CIMC devices and will display \"No Data\": performanceState, operState", "displayedAs": "UCS PSUs", "collectionInterval": "1m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\nimport com.santaba.agent.util.script.ScriptCache\n\n// To run in debug mode, set to true\ndef debug = false\n// To save collector logs, set to true\ndef log = false\n\ndef host = hostProps.get(\"ucs_api.mgmt_host\") ?: hostProps.get(\"system.hostname\") // CIMC devices will use system.hostname\ndef user = hostProps.get(\"ucs_api.user\")\ndef pass = hostProps.get(\"ucs_api.pass\")\ndef port = hostProps.get(\"ucs_api.port\") ?: \"443\"\n\n// Collector version 30.000 or higher required for script cache and snippets\ndef collectorCache = ScriptCache.getCache()\ndef modLoader\ntry {\n modLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n}\ncatch (Exception e) {\n modLoader = new GroovyShell(getBinding()).parse(Snippets.getLoader())\n}\n\ndef lmUcs = modLoader.load(\"cisco.ucs\", \"0\") // Load Cisco UCS module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\ndef url = \"http${port == '80' ? '' : 's'}://${host}:${port}/nuova\"\n\ndef autoprops = [\n \"serial\" : \"serial\",\n \"vendor\" : \"vendor\",\n \"model\" : \"model\",\n \"revision\" : \"hw_revision\",\n \"id\" : \"id\",\n \"psuType\" : \"type\",\n \"partNumber\" : \"part_number\",\n \"psuFirmwareVersion\": \"firmware_version\",\n \"psuInputSrc\" : \"input_source\",\n \"psuWattage\" : \"wattage\"\n]\n\n// Get an XML API authentication cookie\ndef cookie = lmUcs.getCachedCookie(collectorCache, host, url, debug, log)\n\n// If cookie is not a string, something went wrong and we should not continue\nif (cookie.getClass() != String) {\n println \"Issue occurred with cookie. Run script in debug mode for more information.\"\n lmUcs.LMDebugPrint(\"Cookie not retrieved from function call\", debug)\n lmUcs.LMDebugLog(\"Cookie not retrieved from function call\", log)\n return 1\n}\n\n// Request metrics from the API\ndef request = lmUcs.getXMLbyClass(url, \"equipmentPsu\", cookie, false, debug)\n\nrequest.equipmentPsu.each { psu ->\n def dn = lmEmit.sanitizeWildvalue(psu.@dn.toString())\n def tag = psu.@assetTag.toString()\n def ilps = [:]\n\n autoprops.each { k, v ->\n ilps[\"auto.ucs.psu.${v}\"] = psu['@' + k].toString()\n }\n\tilps[\"auto.ucs.owner\"] = \"sys/${dn.split(\"/\")[1]}\"\n\n // Remove ilps with empty/null values\n def cleanILPs = ilps.findAll{ k,v -> (v != null && v != \"\") }\n\n // Create instance with dn as wildvalue and wildalias, tag as description, and cleanILPs as ilps\n lmEmit.instance(dn, dn, tag, cleanILPs)\n}\n\nreturn 0"}, "groupMethod": "ilp", "groupExpr": "auto.ucs.owner"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\nimport com.santaba.agent.util.script.ScriptCache\n\n// To run in debug mode, set to true\ndef debug = false\n// To save collector logs, set to true\ndef log = false\n\ndef host = hostProps.get(\"ucs_api.mgmt_host\") ?: hostProps.get(\"system.hostname\") // CIMC devices will use system.hostname\ndef user = hostProps.get(\"ucs_api.user\")\ndef pass = hostProps.get(\"ucs_api.pass\")\ndef port = hostProps.get(\"ucs_api.port\") ?: \"443\"\n\n// Collector version 30.000 or higher required for script cache and snippets\ndef collectorCache = ScriptCache.getCache()\ndef modLoader\ntry {\n modLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n}\ncatch (Exception e) {\n modLoader = new GroovyShell(getBinding()).parse(Snippets.getLoader())\n}\n\ndef lmUcs = modLoader.load(\"cisco.ucs\", \"0\") // Load Cisco UCS module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\ndef url = \"http${port == '80' ? '' : 's'}://${host}:${port}/nuova\"\n\ndef operabilityMap = [\n \"unknown\" : 0,\n \"operable\" : 1,\n \"inoperable\" : 2,\n \"degraded\" : 3,\n \"powered-off\" : 4,\n \"power-problem\" : 5,\n \"removed\" : 6,\n \"voltage-problem\" : 7,\n \"thermal-problem\" : 8,\n \"performance-problem\" : 9,\n \"accessibility-problem\" : 10,\n \"identity-unestablishable\": 11,\n \"bios-post-timeout\" : 12,\n \"disabled\" : 13,\n \"malformed-fru\" : 14,\n \"backplane-port-problem\" : 15,\n \"chassis-intrusion\" : 16,\n \"non-optimal\" : 17,\n \"unsupported-config\" : 18,\n \"non-optimal-severe\" : 20,\n \"fabric-conn-problem\" : 51,\n \"fabric-unsupported-conn\" : 52,\n \"config\" : 81,\n \"equipment-problem\" : 82,\n \"decomissioning\" : 83,\n \"chassis-limit-exceeded\" : 84,\n \"not-supported\" : 100,\n \"discovery\" : 101,\n \"discovery-failed\" : 102,\n \"identify\" : 103,\n \"post-failure\" : 104,\n \"upgrade-problem\" : 105,\n \"peer-comm-problem\" : 106,\n \"auto-upgrade\" : 107,\n \"link-activate-blocked\" : 108\n]\n\ndef operStateMap = [\n \"unknown\" : 0,\n \"operable\" : 1,\n \"inoperable\" : 2,\n \"degraded\" : 3,\n \"powered-off\" : 4,\n \"power-problem\" : 5,\n \"removed\" : 6,\n \"voltage-problem\" : 7,\n \"thermal-problem\" : 8,\n \"performance-problem\" : 9,\n \"accessibility-problem\" : 10,\n \"identity-unestablishable\": 11,\n \"bios-post-timeout\" : 12,\n \"disabled\" : 13,\n \"malformed-fru\" : 14,\n \"backplane-port-problem\" : 15,\n \"chassis-intrusion\" : 16,\n \"non-optimal\" : 17,\n \"unsupported-config\" : 18,\n \"non-optimal-severe\" : 20,\n \"fabric-conn-problem\" : 51,\n \"fabric-unsupported-conn\" : 52,\n \"config\" : 81,\n \"equipment-problem\" : 82,\n \"decomissioning\" : 83,\n \"chassis-limit-exceeded\" : 84,\n \"not-supported\" : 100,\n \"discovery\" : 101,\n \"discovery-failed\" : 102,\n \"identify\" : 103,\n \"post-failure\" : 104,\n \"upgrade-problem\" : 105,\n \"peer-comm-problem\" : 106,\n \"auto-upgrade\" : 107,\n \"link-activate-blocked\" : 108\n]\n\ndef performance_state_map = [\n \"not-supported\" : -1,\n \"unknown\" : 0,\n \"ok\" : 1,\n \"lower-non-critical\" : 2, // 5\n \"upper-non-critical\" : 3, // 4\n \"lower-critical\" : 4, // 6\n \"upper-critical\" : 5, // 3\n \"lower-non-recoverable\": 6, // 7\n \"upper-non-recoverable\": 7, // 2\n]\n\ndef powerMap = [\n \"not-supported\": -1,\n \"unknown\" : 0,\n \"on\" : 1,\n \"test\" : 2,\n \"off\" : 3,\n \"online\" : 4,\n \"ok\" : 5, // 10\n \"offline\" : 6, // 5\n \"offduty\" : 7, // 6\n \"power-save\" : 8,\n \"degraded\" : 9, // 7\n \"error\" : 10,\n \"failed\" : 11,\n]\n\ndef presence_map = [\n \"unknown\" : 0,\n \"empty\" : 1,\n \"equipped\" : 10,\n \"missing\" : 11,\n \"mismatch\" : 12,\n \"equipped-not-primary\" : 13,\n \"equipped-slave\" : 14,\n \"mismatch-slave\" : 15,\n \"missing-slave\" : 16,\n \"equipped-identity-unestablishable\": 20,\n \"mismatch-identity-unestablishable\": 21,\n \"equipped-with-malformed-fru\" : 22,\n \"inaccessible\" : 30,\n \"unauthorized\" : 40,\n \"not-supported\" : 100,\n \"equipped-unsupported\" : 101,\n \"equipped-deprecated\" : 102,\n \"equipped-disc-not-started\" : 102, // Not a typo, 102 is attributed to both statuses\n \"equipped-disc-in-progress\" : 103,\n \"equipped-disc-error\" : 104,\n \"equipped-disc-unknown\" : 105\n]\n\ndef suspect_map = [\n \"no\" : 0,\n \"yes\" : 1\n]\n\n// Get an XML API authentication cookie\ndef cookie = lmUcs.getCachedCookie(collectorCache, host, url, debug, log)\n\n// If cookie is not a string, something went wrong and we should not continue\nif (cookie.getClass() != String) {\n println \"Issue occurred with cookie. Run script in debug mode for more information.\"\n lmUcs.LMDebugPrint(\"Cookie not retrieved from function call\", debug)\n lmUcs.LMDebugLog(\"Cookie not retrieved from function call\", log)\n return 1\n}\n\n// Request metrics from the API\ndef request = lmUcs.getXMLbyClass(url, \"equipmentPsu\", cookie, false, debug)\ndef requestInputStats = lmUcs.getXMLbyClass(url, \"equipmentPsuInputStats\", cookie, false, debug)\ndef requestStats = lmUcs.getXMLbyClass(url, \"equipmentPsuStats\", cookie, false, debug)\n\nrequest.equipmentPsu.each { psu ->\n def dn = lmEmit.sanitizeWildvalue(psu.@dn.toString())\n\n // Set defaults for data; CIMC devices do not return data for these\n def data = [\n \"current\" : null,\n \"power\" : null,\n \"voltage\" : null,\n \"suspect\" : null\n ]\n if (requestInputStats) {\n // Isolate to entries in each response that are for this psu\n def stats = requestStats.equipmentPsuInputStats.findAll { it.@dn.toString().split(\"/\")[0..2].join(\"/\") == dn }\n data = [\n \"current\" : stats.@current,\n \"power\" : stats.@power,\n \"voltage\" : stats.@voltage,\n \"suspect\" : stats.@suspect\n ]\n }\n\n if (requestStats) {\n // Isolate to entries in each response that are for this psu\n def stats = requestStats.equipmentPsuStats.findAll { it.@dn.toString().split(\"/\")[0..2].join(\"/\") == dn }\n data = [\n \"ambientTemp\" : stats.@ambientTemp,\n \"input210v\" : stats.@input210v,\n \"output12v\" : stats.@output12v,\n \"output3v3\" : stats.@output3v3,\n \"outputCurrent\" : stats.@outputCurrent,\n \"outputPower\" : stats.@outputPower,\n \"suspect\" : stats.@suspect\n ]\n }\n\n def metrics_map = [\n \"performanceState\": performance_state_map[psu.@perf],\n \"operState\" : operStateMap[psu.@operState],\n \"operability\" : operabilityMap[psu.@operability],\n \"powerState\" : powerMap[psu.@power],\n \"presence\" : presence_map[psu.@presence],\n \"thermalState\" : performance_state_map[psu.@thermal],\n \"voltageState\" : performance_state_map[psu.@voltage],\n \"current\" : data.current,\n \"power\" : data.power,\n \"voltage\" : data.voltage,\n \"ambientTemp\" : data.ambientTemp,\n \"input210v\" : data.input210v,\n \"output12v\" : data.output12v,\n \"output3v3\" : data.output3v3,\n \"outputCurrent\" : data.outputCurrent,\n \"outputPower\" : data.outputPower,\n \"suspect\" : suspect_map[data.suspect]\n ]\n\n metrics_map.each { k, v ->\n lmEmit.dp(dn, k, v)\n }\n}\n\nreturn 0"}, "datapoints": [{"name": "ambientTemp", "description": "Ambient temperature in Celsius recorded by the Power Supply Unit.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ambientTemp", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "current", "description": "PSU's current draw, measured in Amps.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.current", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "input210v", "description": "Input 210 volt usage in volts used by the Power Supply Unit.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.input210v", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operability", "description": "Operability state of the PSU. \n0=unknown, \n1=operable, \n2=inoperable, \n3=degraded, \n4=powered-off, \n5=power-problem, \n6=removed, \n7=voltage-problem, \n8=thermal-problem, \n9=performance-problem, \n10=accessibility-problem, \n11=identity-unestablishable, \n12=bios-post-timeout, \n13=disabled, \n14=malformed-fru, \n15=backplane-port-problem, \n16=chassis-intrusion, \n17=non-optimal, \n18=unsupported-config, \n20=non-optimal-severe, \n51=fabric-conn-problem, \n52=fabric-unsupported-conn, \n81=config, \n82=equipment-problem, \n83=decomissioning, \n84=chassis-limit-exceeded, \n100=not-supported, \n101=discovery, \n102=discovery-failed, \n103=identify, \n104=post-failure, \n105=upgrade-problem, \n106=peer-comm-problem, \n107=auto-upgrade, \n108=link-activate-blocked", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.operability", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operationalState", "description": "Operational state of the PSU. \n0=unknown, \n1=operable, \n2=inoperable, \n3=degraded, \n4=powered-off, \n5=power-problem, \n6=removed, \n7=voltage-problem, \n8=thermal-problem, \n9=performance-problem, \n10=accessibility-problem, \n11=identity-unestablishable, \n12=bios-post-timeout, \n13=disabled, \n14=malformed-fru, \n15=backplane-port-problem, \n16=chassis-intrusion, \n17=non-optimal, \n18=unsupported-config, \n20=non-optimal-severe, \n51=fabric-conn-problem, \n52=fabric-unsupported-conn, \n81=config, \n82=equipment-problem, \n83=decomissioning, \n84=chassis-limit-exceeded, \n100=not-supported, \n101=discovery, \n102=discovery-failed, \n103=identify, \n104=post-failure, \n105=upgrade-problem, \n106=peer-comm-problem, \n107=auto-upgrade, \n108=link-activate-blocked", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.operState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "output12v", "description": "Output 12 volt usage in volts used by the Power Supply Unit.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.output12v", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "output3v3", "description": "Output 3.3 volt usage in volts used by the Power Supply Unit.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.output3v3", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "outputCurrent", "description": "Output current in amps by the Power Supply Unit.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.outputCurrent", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "outputPower", "description": "Output power in watts by the Power Supply Unit.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.outputPower", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "performanceState", "description": "Performance state of the PSU. Note that some status codes have been reordered; Cisco provided status codes for these states are shown in parentheses below. \n0=unknown, \n1=ok, \n2=lower-non-critical (5), \n3=upper-non-critical (4), \n4=lower-critical (6), \n5=upper-critical (3), \n6=lower-non-recoverable (7), \n7=upper-non-recoverable (2)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.performanceState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "7", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "power", "description": "PSU power draw, measured in Watts.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.power", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "powerState", "description": "Power state of the PSU. Note that some status codes have been reordered; Cisco provided status codes for these states are shown in parentheses below. \n-1=not-supported (100), \n0=unknown, \n1=on, \n2=test, \n3=off, \n4=online, \n5=ok (10), \n6=offline (5), \n7=offduty (6), \n8=power-save, \n9=degraded (7), \n10=error (9), \n11=failed", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.powerState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "-1", "max": "11", "threshold": "> 8 9 10", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "There is a power state alert for the PSU ##INSTANCE## associated with UCS Manager ##HOST## of status code ##VALUE##, placing the server into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago.\n\nNote that some status codes have been reordered; Cisco provided status codes for these states are shown in parentheses below. Status codes:\n\n-1=not-supported (100)\n0=unknown\n1=on\n2=test\n3=off\n4=online\n5=ok (10)\n6=offline (5)\n7=offduty (6)\n8=power-save\n9=degraded (7)\n10=error (9)\n11=failed"}, {"name": "presence", "description": "Presence status of the of the PSU. \n0=unknown, \n1=empty, \n10=equipped, \n11=missing, \n12=mismatch, \n13=equipped-not-primary, \n14=equipped-slave, \n15=mismatch-slave, \n16=missing-slave, \n20=equipped-identity-unestablishable, \n21=mismatch-identity-unestablishable, \n22=equipped-with-malformed-fru, \n30=inaccessible, \n40=unauthorized, \n101=equipped-unsupported, \n102=equipped-deprecated, \n102=equipped-disc-not-started, \n103=equipped-disc-in-progress, \n104=equipped-disc-error, \n105=equipped-disc-unknown", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.presence", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "suspect", "description": "Indicates whether the data received by performance datapoints should be regarded as suspect. \n0=not suspect, \n1=suspect", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.suspect", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "thermalState", "description": "Overall thermal state of PSU. Note that some status codes have been reordered; Cisco provided status codes for these states are shown in parentheses below. \n0=unknown, \n1=ok, \n2=lower-non-critical (5), \n3=upper-non-critical (4), \n4=lower-critical (6), \n5=upper-critical (3), \n6=lower-non-recoverable (7), \n7=upper-non-recoverable (2)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.thermalState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "7", "threshold": "> 1 3 5", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "There is a thermal alert for the PSU ##INSTANCE## associated with UCS Manager ##HOST## of status code ##VALUE##, placing the server into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago.\n\nNote that some status codes have been reordered; Cisco provided status codes for these states are shown in parentheses below. Status codes:\n\n0=unknown\n1=ok\n2=lower-non-critical (5)\n3=upper-non-critical (4)\n4=lower-critical (6)\n5=upper-critical (3)\n6=lower-non-recoverable (7)\n7=upper-non-recoverable (2)"}, {"name": "voltage", "description": "Voltage of the PSU, measured in Volts.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.voltage", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "voltageState", "description": "Overall voltage state of the PSU. Note that some status codes have been reordered; Cisco provided status codes for these states are shown in parentheses below. \n0=unknown, \n1=ok, \n2=lower-non-critical (5), \n3=upper-non-critical (4), \n4=lower-critical (6), \n5=upper-critical (3), \n6=lower-non-recoverable (7), \n7=upper-non-recoverable (2)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.voltageState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "7", "threshold": "> 1 3 5", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "There is a voltage alert for the PSU ##INSTANCE## associated with UCS Manager ##HOST## of status code ##VALUE##, placing the server into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago.\n\nNote that some status codes have been reordered; Cisco provided status codes for these states are shown in parentheses below. \nStatus codes:\n0=unknown, \n1=ok, \n2=lower-non-critical (5), \n3=upper-non-critical (4), \n4=lower-critical (6), \n5=upper-critical (3), \n6=lower-non-recoverable (7), \n7=upper-non-recoverable (2)"}], "graphs": [{"name": "Ambient Temperature", "title": "Ambient Temperature", "verticalLabel": "\u00b0C", "displayPriority": 40, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ambientTemp", "datapointName": "ambientTemp", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Ambient Temperature", "color": "olive", "datapointName": "ambientTemp", "isVirtual": false}]}, {"name": "Current", "title": "Current", "verticalLabel": "A", "min": 0.0, "displayPriority": 60, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "current", "datapointName": "current", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "PSU Current", "color": "teal", "datapointName": "current", "isVirtual": false}]}, {"name": "Input 210 Voltage", "title": "Input 210 Voltage", "verticalLabel": "V", "min": 0.0, "displayPriority": 71, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "input210v", "datapointName": "input210v", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "210V Input", "color": "fuchsia", "datapointName": "input210v", "isVirtual": false}]}, {"name": "Operability", "title": "Operability", "verticalLabel": "status code", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "operability", "datapointName": "operability", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "State", "color": "silver", "datapointName": "operability", "isVirtual": false}]}, {"name": "Operational State", "title": "Operational State", "verticalLabel": "status code", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "operationalState", "datapointName": "operationalState", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "State", "color": "green", "datapointName": "operationalState", "isVirtual": false}]}, {"name": "Output 3.3 12 Voltage", "title": "Output 3.3 12 Voltage", "verticalLabel": "V", "min": 0.0, "displayPriority": 80, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "output12v", "datapointName": "output12v", "consolidationFn": "average"}, {"name": "output3v3", "datapointName": "output3v3", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "12V Output", "color": "red", "datapointName": "output12v", "isVirtual": false}, {"type": "line", "legend": "3.3V Output", "color": "silver", "datapointName": "output3v3", "isVirtual": false}]}, {"name": "Output Current", "title": "Output Current", "verticalLabel": "A", "min": 0.0, "displayPriority": 61, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "outputCurrent", "datapointName": "outputCurrent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Output Current", "color": "olive", "datapointName": "outputCurrent", "isVirtual": false}]}, {"name": "Output Power", "title": "Output Power", "verticalLabel": "W", "min": 0.0, "displayPriority": 51, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "outputPower", "datapointName": "outputPower", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Output Power", "color": "orange2", "datapointName": "outputPower", "isVirtual": false}]}, {"name": "Performance Metrics Suspect", "title": "Performance Metrics Suspect", "verticalLabel": "0=not-suspect, 1=suspect", "min": 0.0, "max": 2.0, "displayPriority": 11, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "suspect", "datapointName": "suspect", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "Suspect State", "color": "red2", "datapointName": "suspect", "isVirtual": false}]}, {"name": "Performance State", "title": "Performance State", "verticalLabel": "status code", "min": 0.0, "max": 8.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "performanceState", "datapointName": "performanceState", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "State", "color": "fuchsia", "datapointName": "performanceState", "isVirtual": false}]}, {"name": "Power", "title": "Power", "verticalLabel": "W", "min": 0.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "power", "datapointName": "power", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "PSU Power", "color": "yellow", "datapointName": "power", "isVirtual": false}]}, {"name": "Power State", "title": "Power State", "verticalLabel": "status code", "min": -1.0, "max": 12.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "performanceState", "datapointName": "powerState", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "State", "color": "red2", "datapointName": "performanceState", "isVirtual": false}]}, {"name": "Presence State", "title": "Presence State", "verticalLabel": "status code", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "presence", "datapointName": "presence", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Status", "color": "gray", "datapointName": "presence", "isVirtual": false}]}, {"name": "Thermal State", "title": "Thermal State", "verticalLabel": "status code", "min": 0.0, "max": 8.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "thermalState", "datapointName": "thermalState", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "State", "color": "orange2", "datapointName": "thermalState", "isVirtual": false}]}, {"name": "Voltage", "title": "Voltage", "verticalLabel": "V", "min": 0.0, "displayPriority": 70, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "voltage", "datapointName": "voltage", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "PSU Voltage", "color": "olive", "datapointName": "voltage", "isVirtual": false}]}, {"name": "Voltage State", "title": "Voltage State", "verticalLabel": "status code", "min": 0.0, "max": 8.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "voltageState", "datapointName": "voltageState", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "State", "color": "teal", "datapointName": "voltageState", "isVirtual": false}]}], "overviewGraphs": [{"name": "PSUs with Suspect Performance Metrics", "title": "PSUs with Suspect Performance Metrics", "verticalLabel": "0=not-suspect, 1=suspect", "min": 0.0, "max": 2.0, "displayPriority": 5, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "suspect", "datapointName": "suspect", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "suspect", "isVirtual": false}]}, {"name": "Top PSUs by Ambient Temperature", "title": "Top PSUs by Ambient Temperature", "verticalLabel": "\u00b0C", "displayPriority": 6, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ambientTemp", "datapointName": "ambientTemp", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "area", "legend": "##INSTANCE##", "color": "silver", "datapointName": "ambientTemp", "isVirtual": false}]}, {"name": "Top PSUs by Current", "title": "Top PSUs by Current", "verticalLabel": "A", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "current", "datapointName": "current", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "current", "isVirtual": false}]}, {"name": "Top PSUs by Output Current", "title": "Top PSUs by Output Current", "verticalLabel": "A", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "outputCurrent", "datapointName": "outputCurrent", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "outputCurrent", "isVirtual": false}]}, {"name": "Top PSUs by Output Power", "title": "Top PSUs by Output Power", "verticalLabel": "W", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "outputPower", "datapointName": "outputPower", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "outputPower", "isVirtual": false}]}, {"name": "Top PSUs by Power", "title": "Top PSUs by Power", "verticalLabel": "W", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "power", "datapointName": "power", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "power", "isVirtual": false}]}, {"name": "Top PSUs by Thermal State", "title": "Top PSUs by Thermal State", "verticalLabel": "status code", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "thermalState", "datapointName": "thermalState", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "thermalState", "isVirtual": false}]}, {"name": "Top PSUs by Voltage", "title": "Top PSUs by Voltage", "verticalLabel": "V", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "voltage", "datapointName": "voltage", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "voltage", "isVirtual": false}]}]}

×DataSource: Fujitsu_Eternus_Volumes (384)

{"name": "Fujitsu_Eternus_Volumes", "description": "Monitors Fujitsu Eternus volume operating status and various performance metrics.", "appliesTo": "hasCategory(\"FujitsuEternus\")", "technicalNotes": "- must provide ssh.user & ssh.pass\n- to auto-associate with Fujitsu Eternus devices, be sure to import the addCategory_FujitsuEternus PropertySource", "displayedAs": "Fujitsu Eternus Volumes", "collectionInterval": "4m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.expect.Expect\nimport com.santaba.agent.util.Settings;\n\n/**\n *\n * VARIOUS PATTERNS\n *\n Volume Status Type RG or TPP or FTRP Size(MB) Copy\n\n Volume Status Type Encryption Expansion RG or TPP or FTRP Size(MB) Reserved Copy\n */\n\ndef hostname = hostProps.get(\"system.hostname\");\ndef user = hostProps.get(\"ssh.user\");\ndef pass = hostProps.get(\"ssh.pass\");\ndef timeout = hostProps.get(\"ssh.timeout\") ?: Settings.getGroovyExpectTimeoutInSecond();\n\n// Generic Prompt Match\ndef prompt = '[>#$]';\n\n// Open an Expect session on the host\ndef cli = Expect.open(hostname, user, pass, timeout);\n\n// Look for one of a few likely prompt characters\ncli.expect(prompt);\n\n// Update the prompt to have a closer match.\nprompt = cli.before().readLines().last().trim() + prompt;\n\n// Send the command\ncli.send(\"show volumes\\n\");\ncli.expect(prompt);\n\n// Store returned text from the CLI\ndef results = cli.before();\n\n// Send \"exit\" and close the session\ncli.send(\"exit\\n\");\ncli.close();\n\ndef identified_pattern = regexPatternFinder(results)\ndef volumes_pattern = ~identified_pattern.pattern_regex\n\nresults.readLines().each { line ->\n\n def output_matcher = volumes_pattern.matcher(line)\n\n if (output_matcher) {\n\n def wildvalue = \"${output_matcher[0][1]} ${output_matcher[0][2]}\".trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\");\n def wildalias = \"[${output_matcher[0][1]}] ${output_matcher[0][2]}\".trim()\n def type = output_matcher[0][4].toString().trim()\n\n if (identified_pattern.pattern_name == 'default') {\n group = output_matcher[0][6].toString().trim()\n } else if (identified_pattern.pattern_name == 'pattern1') {\n group = output_matcher[0][8].toString().trim()\n }\n\n println \"${wildvalue}##${wildalias}##${group} || ${type}####\" +\n \"auto.fujitsu.eternus.volume.type=${type}&\" +\n \"auto.fujitsu.eternus.volume.group=${group}\"\n }\n}\n\nreturn 0;\n\n/**\n * Helper function to identify regex pattern.\n * @param cli_output\n * @return\n */\ndef regexPatternFinder(cli_output) {\n\n // Default to a pattern, unless otherwise we identify another pattern that matches.\n\n // Volume Status Type RG or TPP or FTRP Size(MB) Copy\n def volumes_default_regex = /(\\d+)\\s+(.*)\\s+(\\w+)\\s+(\\w+)\\s+(\\d+)\\s+(\\w+)\\s+(\\d+)\\s+(\\w+)/\n\n Map regex_pattern = [pattern_name : 'default',\n pattern_regex: volumes_default_regex]\n\n // Volume Status Type Encryption Expansion RG or TPP or FTRP Size(MB) Reserved Copy\n def volumes_pattern1_regex = /(\\d+)\\s+(.*)\\s+(\\w+)\\s+(\\w+)\\s+(\\w+)\\s+(\\d+|\\-)\\s+(\\d+)\\s+(.*)\\s+(\\d+)\\s+(\\w+)/\n\n if (cli_output.contains('Encryption Expansion')) {\n\n regex_pattern.pattern_name = 'pattern1'\n regex_pattern.pattern_regex = volumes_pattern1_regex\n }\n\n return regex_pattern\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.expect.Expect\nimport com.santaba.agent.util.Settings\nimport com.vmware.vim25.UpdateReferenceHostRequestType;\n\n/**\n *\n * VARIOUS PATTERNS\n *\n Volume Status Type RG or TPP or FTRP Size(MB) Copy\n\n Volume Status Type Encryption Expansion RG or TPP or FTRP Size(MB) Reserved Copy\n */\n\ndef hostname = hostProps.get(\"system.hostname\");\ndef user = hostProps.get(\"ssh.user\");\ndef pass = hostProps.get(\"ssh.pass\");\ndef timeout = hostProps.get(\"ssh.timeout\") ?: Settings.getGroovyExpectTimeoutInSecond();\n\n// Generic Prompt Match\ndef prompt = '[>#$]';\n\n// Open an Expect session on the host\ndef cli = Expect.open(hostname, user, pass, timeout);\n\n// Look for one of a few likely prompt characters\ncli.expect(prompt);\n\n// Update the prompt to have a closer match.\nprompt = cli.before().readLines().last().trim() + prompt;\n\n// Send the command\ncli.send(\"show volumes\\n\");\ncli.expect(prompt);\n\n// Store returned text from the CLI\ndef results = cli.before();\n\n// clear prompt\ncli.send(\"show performance -type host-io\\n\");\ncli.expect(prompt);\n\n// save performance results.\ndef perf_results = cli.before()\n\n// Send \"exit\" and close the session\ncli.send(\"exit\\n\");\ncli.close();\n\ndef identified_pattern = regexPatternFinder(results)\ndef volumes_pattern = ~identified_pattern.pattern_regex\n\nMap statusCodes = [\"Available\": 1]\n\nresults.readLines().each { line ->\n\n def output_matcher = volumes_pattern.matcher(line)\n\n if (output_matcher) {\n\n def wildvalue = \"${output_matcher[0][1]} ${output_matcher[0][2]}\".trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\");\n\n // Print the metrics and the wildvalue\n println \"${wildvalue}.Status=${statusCodes[output_matcher[0][3]] ?: 0}\"\n\n if (identified_pattern.pattern_name == 'default') {\n\n println \"${wildvalue}.Size=${output_matcher[0][7].toLong() * 1048576L}\"\n } else if (identified_pattern.pattern_name == 'pattern1') {\n println \"${wildvalue}.Size=${output_matcher[0][9].toLong() * 1048576L}\"\n }\n }\n}\n\n///////////// PERFORMANCE ////////////\n// save command output and split on newlines .\ndef perf_command_output = perf_results\n\ndef perf_data_pattern_with_processing_time = ~/_(\\d+)\\s(.*)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_/\ndef perf_data_pattern_without_processing_time = ~/_(\\d+)\\s(.*)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_(\\d+)_/\n\n// identify which CLI format is being used.\nif (perf_command_output.contains('Processing Time(msec.)')) {\n perf_data_pattern_version = perf_data_pattern_with_processing_time\n} else {\n perf_data_pattern_version = perf_data_pattern_without_processing_time\n}\n\nperf_command_output.eachLine { line ->\n\n def sanitized_line = line.replaceAll(/\\s{2,}/, \"_\")\n\n // yes. process it\n def matcher = perf_data_pattern_version.matcher(sanitized_line)\n\n if (matcher) {\n\n def vol_number = matcher[0][1]\n def vol_name = matcher[0][2]\n\n // Sanitize the wildvalue\n def wildvalue = \"${vol_number} ${vol_name}\".trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\");\n\n // Print the metrics and the wildvalue\n\n //_1 CCR_ Datastore01_313_243_33_28_4_4_1_1_90_100_72_\n // Volume IOPS(IOPS) Throughput(MB/s) Response Time(msec.) Processing Time(msec.) Cache Hit Rate(%)\n //No. Name Read / Write Read / Write Read / Write Read / Write Read / Write / Prefetch\n //----- -------------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n // 0 Inf_Datastore01 8 45 1 1 9 8 1 6 93 100 1\n\n if (perf_data_pattern_version == perf_data_pattern_with_processing_time) {\n\n println \"${wildvalue}.ReadIOPS=${matcher[0][3]}\";\n println \"${wildvalue}.WriteIOPS=${matcher[0][4]}\";\n\n println \"${wildvalue}.ReadThroughput=${matcher[0][5].toLong() * 1048576L}\";\n println \"${wildvalue}.WriteThroughput=${matcher[0][6].toLong() * 1048576L}\";\n\n println \"${wildvalue}.ReadResponseTimeMs=${matcher[0][7]}\";\n println \"${wildvalue}.WriteResponseTimeMs=${matcher[0][8]}\";\n\n println \"${wildvalue}.ReadProcessingTimeMs=${matcher[0][9]}\";\n println \"${wildvalue}.WriteProcessingTimeMs=${matcher[0][10]}\";\n\n println \"${wildvalue}.ReadCacheHitRate=${matcher[0][11]}\";\n println \"${wildvalue}.WriteCacheHitRate=${matcher[0][12]}\";\n println \"${wildvalue}.PrefetchCacheHitRate=${matcher[0][13]}\";\n\n } else if (perf_data_pattern_version == perf_data_pattern_without_processing_time) {\n\n println \"${wildvalue}.ReadIOPS=${matcher[0][3]}\";\n println \"${wildvalue}.WriteIOPS=${matcher[0][4]}\";\n\n println \"${wildvalue}.ReadThroughput=${matcher[0][5].toLong() * 1048576L}\";\n println \"${wildvalue}.WriteThroughput=${matcher[0][6].toLong() * 1048576L}\";\n\n println \"${wildvalue}.ReadResponseTimeMs=${matcher[0][7]}\";\n println \"${wildvalue}.WriteResponseTimeMs=${matcher[0][8]}\";\n\n println \"${wildvalue}.ReadCacheHitRate=${matcher[0][9]}\";\n println \"${wildvalue}.WriteCacheHitRate=${matcher[0][10]}\";\n println \"${wildvalue}.PrefetchCacheHitRate=${matcher[0][11]}\";\n\n }\n }\n}\n\nreturn 0;\n\n/**\n * Helper function to identify regex pattern.\n * @param cli_output\n * @return\n */\ndef regexPatternFinder(cli_output) {\n\n // Default to a pattern, unless otherwise we identify another pattern that matches.\n\n // Volume Status Type RG or TPP or FTRP Size(MB) Copy\n def volumes_default_regex = /(\\d+)\\s+(.*)\\s+(\\w+)\\s+(\\w+)\\s+(\\d+)\\s+(\\w+)\\s+(\\d+)\\s+(\\w+)/\n\n Map regex_pattern = [pattern_name : 'default',\n pattern_regex: volumes_default_regex]\n\n // Volume Status Type Encryption Expansion RG or TPP or FTRP Size(MB) Reserved Copy\n def volumes_pattern1_regex = /(\\d+)\\s+(.*)\\s+(\\w+)\\s+(\\w+)\\s+(\\w+)\\s+(\\d+|\\-)\\s+(\\d+)\\s+(.*)\\s+(\\d+)\\s+(\\w+)/\n\n if (cli_output.contains('Encryption Expansion')) {\n\n regex_pattern.pattern_name = 'pattern1'\n regex_pattern.pattern_regex = volumes_pattern1_regex\n }\n\n return regex_pattern\n}"}, "datapoints": [{"name": "PrefetchCacheHitRate", "description": "Prefetch cache hit rate in percent.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.PrefetchCacheHitRate", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ReadCacheHitRate", "description": "Read cache hit rate in percent.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ReadCacheHitRate", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ReadIOPS", "description": "Read operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ReadIOPS", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ReadProcessingTimeMs", "description": "Read operation processing time, in milliseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ReadProcessingTimeMs", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ReadResponseTimeMs", "description": "Read response time in milliseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ReadResponseTimeMs", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ReadThroughput", "description": "Read throughput in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ReadThroughput", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Size", "description": "Size of the volume in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Size", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Status", "description": "Current operating status.\n\nStatus Codes:\n0=Unknown,\n1=Available", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Status", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WriteCacheHitRate", "description": "Write cache hit rate in percent.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.WriteCacheHitRate", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WriteIOPS", "description": "Write operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.WriteIOPS", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WriteProcessingTimeMs", "description": "Write operation processing time, in milliseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.WriteProcessingTimeMs", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WriteResponseTimeMs", "description": "Write response time in milliseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.WriteResponseTimeMs", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WriteThroughput", "description": "Write throughput in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.WriteThroughput", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Cache Hit Rate", "title": "Cache Hit Rate", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 4, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "PrefetchCacheHitRate", "datapointName": "PrefetchCacheHitRate", "consolidationFn": "average"}, {"name": "ReadCacheHitRate", "datapointName": "ReadCacheHitRate", "consolidationFn": "average"}, {"name": "WriteCacheHitRate", "datapointName": "WriteCacheHitRate", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Prefetch", "color": "yellow", "datapointName": "PrefetchCacheHitRate", "isVirtual": false}, {"type": "line", "legend": "Read", "color": "navy", "datapointName": "ReadCacheHitRate", "isVirtual": false}, {"type": "line", "legend": "Write", "color": "green", "datapointName": "WriteCacheHitRate", "isVirtual": false}]}, {"name": "IOPS", "title": "IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "ReadIOPS", "datapointName": "ReadIOPS", "consolidationFn": "average"}, {"name": "WriteIOPS", "datapointName": "WriteIOPS", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "TotalIOPS", "expr": "ReadIOPS + WriteIOPS"}], "lines": [{"type": "stack", "legend": "Read", "color": "aqua", "datapointName": "ReadIOPS", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "gray", "datapointName": "TotalIOPS", "isVirtual": true}, {"type": "stack", "legend": "Write", "color": "lime", "datapointName": "WriteIOPS", "isVirtual": false}]}, {"name": "Latency", "title": "Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "ReadProcessingTimeMs", "datapointName": "ReadProcessingTimeMs", "consolidationFn": "average"}, {"name": "ReadResponseTimeMs", "datapointName": "ReadResponseTimeMs", "consolidationFn": "average"}, {"name": "WriteProcessingTimeMs", "datapointName": "WriteProcessingTimeMs", "consolidationFn": "average"}, {"name": "WriteResponseTimeMs", "datapointName": "WriteResponseTimeMs", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Read Processing", "color": "aqua", "datapointName": "ReadProcessingTimeMs", "isVirtual": false}, {"type": "line", "legend": "Read Response", "color": "silver", "datapointName": "ReadResponseTimeMs", "isVirtual": false}, {"type": "line", "legend": "Write Processing", "color": "lime", "datapointName": "WriteProcessingTimeMs", "isVirtual": false}, {"type": "line", "legend": "Write Response", "color": "green", "datapointName": "WriteResponseTimeMs", "isVirtual": false}]}, {"name": "Operating Status", "title": "Operating Status", "verticalLabel": "0=unknown, 1=available", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "navy", "datapointName": "Status", "isVirtual": false}]}, {"name": "Storage Size", "title": "Storage Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "Size", "datapointName": "Size", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Total", "color": "orange2", "datapointName": "Size", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "ReadThroughput", "datapointName": "ReadThroughput", "consolidationFn": "average"}, {"name": "WriteThroughput", "datapointName": "WriteThroughput", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "TotalThroughput", "expr": "ReadThroughput + WriteThroughput"}], "lines": [{"type": "stack", "legend": "Read", "color": "teal", "datapointName": "ReadThroughput", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "gray", "datapointName": "TotalThroughput", "isVirtual": true}, {"type": "stack", "legend": "Write", "color": "olive", "datapointName": "WriteThroughput", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Volumes by Highest Cache Read Hit Percentage", "title": "Top 10 Volumes by Highest Cache Read Hit Percentage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 4, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ReadCacheHitRate", "datapointName": "ReadCacheHitRate", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "ReadCacheHitRate", "isVirtual": false}]}, {"name": "Top 10 Volumes by Highest Latency", "title": "Top 10 Volumes by Highest Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ReadResponseTimeMs", "datapointName": "ReadResponseTimeMs", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "WriteResponseTimeMs", "datapointName": "WriteResponseTimeMs", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "totalResponseTimeMs", "expr": "ReadResponseTimeMs+WriteResponseTimeMs"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "totalResponseTimeMs", "isVirtual": true}]}, {"name": "Top 10 Volumes by Lowest Cache Read Hit Percentage", "title": "Top 10 Volumes by Lowest Cache Read Hit Percentage", "verticalLabel": "%", "min": -100.0, "max": 0.0, "displayPriority": 5, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ReadCacheHitRate", "datapointName": "ReadCacheHitRate", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "negatedReachCacheHitRate", "expr": "ReadCacheHitRate*(0-1)"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "negatedReachCacheHitRate", "isVirtual": true}]}, {"name": "Top 10 Volumes by Total IOPS", "title": "Top 10 Volumes by Total IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ReadIOPS", "datapointName": "ReadIOPS", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "WriteIOPS", "datapointName": "WriteIOPS", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "totalIOPS", "expr": "ReadIOPS + WriteIOPS"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "totalIOPS", "isVirtual": true}]}, {"name": "Top 10 Volumes by Total Throughput", "title": "Top 10 Volumes by Total Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "ReadThroughput", "datapointName": "ReadThroughput", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "WriteThroughput", "datapointName": "WriteThroughput", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "totalThroughput", "expr": "ReadThroughput + WriteThroughput"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "totalThroughput", "isVirtual": true}]}]}

×DataSource: Huawei_Chassis_OpticalStats (1193)

{"name": "Huawei_Chassis_OpticalStats", "description": "Monitors optical module statistics such as temperature, voltage, signal strength, and admin state.", "appliesTo": "hasCategory(\"Huawei\")", "searchKeywords": "huawei,chassis,optical", "technicalNotes": "User may wish to filter out instances which display negative values for Voltage. A filter can be added: \n\n1.3.6.1.4.1.2011.5.25.31.1.1.3.1.6.##WILDVALUE## ; GreaterThan ; 0", "displayedAs": "Huawei Chassis Optical Stats", "collectionInterval": "3m", "collectionMethod": "snmp", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\n// variable to hold system hostname\ndef host = hostProps.get('system.hostname')\ndef props = hostProps.toProperties()\ndef timeout = 100000 \ndef instanceMap = [:]\n\n\n\n\nSnmp.walkAsMap(host, \"1.3.6.1.4.1.2011.5.25.31.1.1.3.1.1\", null, 30000).each { key, mode ->\n def tx = Snmp.get(host, \"1.3.6.1.4.1.2011.5.25.31.1.1.3.1.9.$key\")\n def vol = Snmp.get(host, \"1.3.6.1.4.1.2011.5.25.31.1.1.3.1.6.$key\")\n mode = mode.trim()\n\n if (tx != \"-1\" && vol != \"-1\" && mode != \"1\") {\n\n def serial_no = Snmp.get(host, \"1.3.6.1.4.1.2011.5.25.31.1.1.3.1.4.$key\").trim()\n def name = Snmp.get(host, \"1.3.6.1.2.1.47.1.1.1.1.7.$key\").trim()\n def mfg = Snmp.get(host, \"1.3.6.1.2.1.47.1.1.1.1.12.$key\").trim()\n\n\n // Collect properties\n def instance_props = [\n 'auto.optical.mode' : mode,\n 'auto.optical.mfg' : mfg,\n 'auto.optical.serial' : serial_no\n ]\n\n // Optional properties, not consistent enough to be relied on to return on every host\n // Instead if we get a value for them we keep them, if not we continue on. \n try {\n def pType = Snmp.get(host, \"1.3.6.1.4.1.2011.5.25.31.1.1.1.1.20.$key\").trim().orElse(\"\")\n def type = Snmp.get(host, \"1.3.6.1.2.1.47.1.1.1.1.10.$key\").trim().orElse(\"\")\n def fType = Snmp.get(host, \"1.3.6.1.4.1.2011.5.25.31.1.1.3.1.12.$key\").trim()orElse(\"\")\n\n if (fType) {\n instance_props[\"auto.optical.fType\"] = fType\n } \n\n if (type) {\n instance_props[\"auto.optical.type\"] = type\n }\n\n if (pType) {\n instance_props[\"auto.optical.pType\"] = pType\n }\n }\n catch (Exception e) {\n // continue on \n }\n // Encode our properties\n def encoded_instance_props_array = instance_props.collect()\n { property, value ->\n URLEncoder.encode(property.toString()) + \"=\" + URLEncoder.encode(value.toString())\n }\n\n // Write instances with props\n println \"$key##$name##$serial_no####\" + encoded_instance_props_array.join(\"&\")\n }\n\n}\n\nreturn 0\n"}, "groupMethod": "none"}, "datapoints": [{"name": "AdminStatus", "description": "Represents the various possible administrative status codes.\n\nStatus Codes:\n\t\n1 = notSupported\n2 = locked\n3 = shuttingDown\n4 = unlocked\n11 = up\n12 = down\n13 = loopback", "config": {"oid": "1.3.6.1.4.1.2011.5.25.31.1.1.1.1.1.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "13", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BiasCurrent", "description": "Bias Current", "config": {}, "interpretMethod": "expression", "interpretExpr": "BiasCurrentMicroamps/1000", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BiasCurrentMicroamps", "description": "The bias current of the optical module. Unit: microamps.", "config": {"oid": "1.3.6.1.4.1.2011.5.25.31.1.1.3.1.7.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Mode", "description": "Represents the various possible administrative states.\n\nStatus Codes:\n\n1 = notSupported\n2 = singleMode\n3 = multiMode5\n4 = multiMode6\n5 = noValue", "config": {"oid": "1.3.6.1.4.1.2011.5.25.31.1.1.3.1.1.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "5", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OperatingState", "description": "Represents the possible values of operational status codes: \n\n1 = notSupported\n2 = disabled\n3 = enabled\n4 = offline \n11 = up\n12 = down\n13 = connect\n15 = protocolUp\n16 = linkUp\t \n17 = linkDown", "config": {"oid": "1.3.6.1.4.1.2011.5.25.31.1.1.1.1.2.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "1", "max": "17", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The operation status of ##HOST## is no longer in an enabled. The current state is ##VALUE##, placing the device into ##LEVEL## state. \n\nStatus codes:\n\n1 = notSupported\n2 = disabled\n3 = enabled\n4 = offline \n11 = up\n12 = down\n13 = connect\n15 = protocolUp\n16 = linkUp\t \n17 = linkDown\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "ReceivedPower", "description": "Receive power of the optical module in decibel-milliwatts", "config": {}, "interpretMethod": "expression", "interpretExpr": "RxPower/100", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RxPower", "description": "The receive power of the optical module. Unit: dBm.\n\nBy default, Huawei expands the value of this OID 100 times, so the real value is stored in ReceivedPower.", "config": {"oid": "1.3.6.1.4.1.2011.5.25.31.1.1.3.1.8.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Temperature", "description": "Current Temperature for entity measured in degrees Celsius.", "config": {"oid": "1.3.6.1.4.1.2011.5.25.31.1.1.3.1.5.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TransmitPower", "description": "Transmit power of the optical module in decibel-milliwatts", "config": {}, "interpretMethod": "expression", "interpretExpr": "TxPower/100", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TxPower", "description": "The receive power of the optical module. Unit: dBm.\n\nBy default, Huawei expands the value of this OID 100 times, so the real value is stored in TransmitPower.", "config": {"oid": "1.3.6.1.4.1.2011.5.25.31.1.1.3.1.9.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Voltage", "description": "The current voltage of the optical module. Unit: mV.", "config": {"oid": "1.3.6.1.4.1.2011.5.25.31.1.1.3.1.6.##WILDVALUE##"}, "interpretMethod": "none", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Volts", "description": "Datapoint used for translating millivolts into volts", "config": {}, "interpretMethod": "expression", "interpretExpr": "Voltage/1000", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Admin Status", "title": "Admin Status", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AdminStatus", "datapointName": "AdminStatus", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Admin Status", "color": "green", "datapointName": "AdminStatus", "isVirtual": false}]}, {"name": "Bias Current", "title": "Bias Current", "verticalLabel": "microamps", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BiasCurrent", "datapointName": "BiasCurrent", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Bias Current", "color": "silver", "datapointName": "BiasCurrent", "isVirtual": false}]}, {"name": "Mode", "title": "Mode", "verticalLabel": "status code", "min": 0.0, "max": 6.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Mode", "datapointName": "Mode", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Mode", "color": "silver", "datapointName": "Mode", "isVirtual": false}]}, {"name": "Operating State", "title": "Operating State", "verticalLabel": "status code", "min": 0.0, "max": 5.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "OperatingState", "datapointName": "OperatingState", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "##INSTANCE##", "color": "silver", "datapointName": "OperatingState", "isVirtual": false}]}, {"name": "Temperature", "title": "Temperature", "verticalLabel": "\u00b0C", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Temperature", "datapointName": "Temperature", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Temperature", "color": "blue", "datapointName": "Temperature", "isVirtual": false}]}, {"name": "Trans/Received Milliwatts", "title": "Trans/Received Milliwatts", "verticalLabel": "dBm", "min": -10.0, "max": 15.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ReceivedPower", "datapointName": "ReceivedPower", "consolidationFn": "max"}, {"name": "TransmitPower", "datapointName": "TransmitPower", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Received Power", "color": "red2", "datapointName": "ReceivedPower", "isVirtual": false}, {"type": "line", "legend": "Transmit Power", "color": "green", "datapointName": "TransmitPower", "isVirtual": false}]}, {"name": "Voltage", "title": "Voltage", "verticalLabel": "volts", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Voltage", "datapointName": "Voltage", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Voltage", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top Instances by Temperature", "title": "Top Instances by Temperature", "verticalLabel": "\u00b0C", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Temperature", "datapointName": "Temperature", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Temperature", "isVirtual": false}]}, {"name": "Top Instances by Transmit & Received Power", "title": "Top Instances by Transmit & Received Power", "verticalLabel": "dBm", "min": -10.0, "max": 15.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ReceivedPower", "datapointName": "ReceivedPower", "consolidationFn": "max", "aggregateMethod": "max"}, {"name": "TransmitPower", "datapointName": "TransmitPower", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE## dBm", "color": "silver", "datapointName": "ReceivedPower", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## dBm", "color": "silver", "datapointName": "TransmitPower", "isVirtual": false}]}, {"name": "Top Instances by Voltage", "title": "Top Instances by Voltage", "verticalLabel": "volts", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Voltage", "datapointName": "Volts", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Voltage", "isVirtual": false}]}]}

×DataSource: Microsoft_Azure_VMs (693)

{"name": "Microsoft_Azure_VMs", "description": "Monitors Microsoft Azure virtual machine CPU utilization, network throughput, disk throughput and disk IOPS.", "appliesTo": "hasCategory(\"Azure/VirtualMachine\")", "searchKeywords": "cloud,disk,vm,cpu,microsoft,azure", "technicalNotes": "- Available metrics: https://docs.microsoft.com/en-us/azure/azure-monitor/platform/metrics-supported#microsoftcomputevirtualmachines", "displayedAs": "Azure Virtual Machines", "collectionInterval": "1m", "collectionMethod": "azureinsights", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "DiskReadBytes", "description": "Average number of bytes, per second, read from the disk.", "interpretMethod": "json", "interpretExpr": "Disk Read Bytes.average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskReadOperationsPerSec", "description": "Average number of read operations, per second, on the disk.", "interpretMethod": "json", "interpretExpr": "Disk Read Operations/Sec.average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskWriteBytes", "description": "Average number of bytes, per second, written to disk.", "interpretMethod": "json", "interpretExpr": "Disk Write Bytes.average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskWriteOperationsPerSec", "description": "Average number of write operations, per second, on the disk.", "interpretMethod": "json", "interpretExpr": "Disk Write Operations/Sec.average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NetworkIn", "description": "The average number of bytes received, per second, on all network interfaces by the Virtual Machine(s).", "interpretMethod": "json", "interpretExpr": "Network In Total.average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NetworkOut", "description": "The average number of bytes sent, per second, on all network interfaces by the Virtual Machine(s).", "interpretMethod": "json", "interpretExpr": "Network Out Total.average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PercentageCPU", "description": "The average percentage of allocated compute units that are currently in use by the Virtual Machine(s)", "interpretMethod": "json", "interpretExpr": "Percentage CPU.average", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0.0", "max": "100.0", "threshold": ">= 90 95", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "Microsoft Azure Virtual Machine ##INSTANCE## on ##HOST## is experience high CPU utilization exceeding ##VALUE##% , placing the VM into ##LEVEL## state.\n\nIf CPU percent utilization is consistently high, you may considering upgrading to a higher virtual machine size via the Windows Azure Management Portal.\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "CPU Utilization", "title": "CPU Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PercentageCPU", "datapointName": "PercentageCPU", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "CPU", "color": "orange", "datapointName": "PercentageCPU", "isVirtual": false}]}, {"name": "Disk IOPS", "title": "Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskReadOperationsPerSec", "datapointName": "DiskReadOperationsPerSec", "consolidationFn": "average"}, {"name": "DiskWriteOperationsPerSec", "datapointName": "DiskWriteOperationsPerSec", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Total", "expr": "DiskReadOperationsPerSec+DiskWriteOperationsPerSec"}], "lines": [{"type": "stack", "legend": "Read", "color": "teal", "datapointName": "DiskReadOperationsPerSec", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "olive", "datapointName": "DiskWriteOperationsPerSec", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "Total", "isVirtual": true}]}, {"name": "Disk Throughput", "title": "Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "DiskReadBytes", "datapointName": "DiskReadBytes", "consolidationFn": "average"}, {"name": "DiskWriteBytes", "datapointName": "DiskWriteBytes", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Total", "expr": "DiskReadBytes+DiskWriteBytes"}], "lines": [{"type": "stack", "legend": "Disk Read", "color": "aqua", "datapointName": "DiskReadBytes", "isVirtual": false}, {"type": "stack", "legend": "Disk Write", "color": "lime", "datapointName": "DiskWriteBytes", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "Total", "isVirtual": true}]}, {"name": "Network Throughput", "title": "Network Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "NetworkIn", "datapointName": "NetworkIn", "consolidationFn": "average"}, {"name": "NetworkOut", "datapointName": "NetworkOut", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Inbound ", "color": "aqua", "datapointName": "NetworkIn", "isVirtual": false}, {"type": "line", "legend": "Outbound", "color": "olive", "datapointName": "NetworkOut", "isVirtual": false}]}]}

×DataSource: Oracle_Database_RMANLatestBackupFiles (923)

{"name": "Oracle_Database_RMANLatestBackupFiles", "description": "Information on backups without a \"Set\" type.", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "database,oracle,rman,db,backups", "technicalNotes": "For additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle Backup and Recovery Latest Backup Files by Type (No Sets)", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef queryOutput = [:]\ndef conn = [:]\n\nsqlQuery = \"SELECT distinct BACKUP_TYPE, DEVICE_TYPE,FILE_TYPE FROM V\\$BACKUP_FILES WHERE BACKUP_TYPE != 'BACKUP SET' \"\n\n// go grab all the database names\ndisplayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\n\ndbnamesList.each { dbname ->\n\tuser = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n\tpass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n\tport = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n\t//attempt to make a connection.\n\tconn = attemptConnection(host, port, dbname, user, pass)\n\n\tif (conn.status == 'success')\n\t{\n\t\tqueryOutput = runQuery(sqlQuery, conn['connection'])\n\n\t\tif (queryOutput.status == \"Success\")\n\t\t{\n\t\t\tqueryOutput[\"data\"].each { data ->\n\t\t\t\tdef wildvalue = dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") + \"||\" + ((data.DEVICE_TYPE ?: \"Unknown\") +\"_\"+ (data.FILE_TYPE ?: \"Unknown\")+\"_\"+(data.BACKUP_TYPE ?: \"Unknown\")).replaceAll(/[:|\\\\|\\s|=]+/,\"_\")\n\t\t\t\tdef wildalias = ((data.DEVICE_TYPE ?: \"Unknown\") +\"->\"+ (data.FILE_TYPE ?: \"Unknown\")+\"->\"+(data.BACKUP_TYPE ?: \"Unknown\")).replaceAll(/[:|\\\\|\\s|=]+/,\"_\") + \" (\" + dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") +\")\"\n\t\t\t\tdef autoProps = []\n\t\t\t\tautoProps.push(\"auto.databasename=\"+dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\"))\n\t\t\t\tprintln \"${wildvalue}##${wildalias}######${autoProps.join('&')}\"\n\t\t\t}\n\t\t}\n\t\t// always close the connection\n\t\tconn.connection.close()\n\t}\n}\n\nreturn 0\n\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n\tdef returnArray = [:]\n\tdef errors = []\n\tdef connComplete\n\tdef db_connection\n\n\ttry\n\t{\n\t\tdef url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n\t\t// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n\t\t// Create a connection to the database.\n\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\tconnComplete = true\n\n\t}\n\tcatch (Exception e)\n\t{\n\t\t// Print out the exception and exit with 1.\n\t\terrors[0] = e.message\n\t\tconnComplete = false\n\t}\n\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n\tif (connComplete == false)\n\t{\n\t\ttry\n\t\t{\n\t\t\turl = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n\t\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\t\tconnComplete = true\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t// Print out the exception and exit with 1.\n\t\t\terrors[1] = e.message\n\t\t\tconnComplete = false\n\t\t}\n\t}\n\n\t// populate the connection and any messages for the return array\n\tif (connComplete == true) {\n\n\t\treturnArray['connection'] = db_connection\n\t\treturnArray['status'] = 'success'\n\t}\n\telse\n\t{\n\t\treturnArray['status'] = 'failed'\n\t\treturnArray['errors'] = errors\n\t}\n\n\treturn returnArray\n}\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\n\t\treturnArray['data'] = conn.rows(sqlQuery)\n\t\treturnArray['status'] = 'Success'\n\t\treturnArray['error'] = ''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\t\treturnArray['data'] = conn.execute(sqlQuery)\n\t\treturnArray['status'] = \"Success\"\n\t\treturnArray['error']=''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef queryOutput = [:]\ndef conn = [:]\ndef statusTypes = [\"AVAILABLE\",\"UNAVAILABLE\",\"OTHER\",\"EXPIRED\"]\n\nsqlQuery = \" SELECT a.BLOCK_SIZE, a.BACKUP_TYPE, a.DEVICE_TYPE, a.FILE_TYPE, STATUS, BYTES , \" +\n\" ROUND(((select CURRENT_DATE from dual) - COMPLETION_TIME) * 24,2) as AGE_IN_HOURS FROM V\\$BACKUP_FILES a inner join \" +\n\" ( SELECT BACKUP_TYPE, DEVICE_TYPE,FILE_TYPE, MAX(COMPLETION_TIME) as MAX_TIME FROM V\\$BACKUP_FILES WHERE BACKUP_TYPE != 'BACKUP SET' GROUP BY BACKUP_TYPE, DEVICE_TYPE,FILE_TYPE ) q \" +\n\" on q.BACKUP_TYPE = a.BACKUP_TYPE and q.FILE_TYPE = a.FILE_TYPE and q.MAX_TIME = a.COMPLETION_TIME \" +\n\" WHERE a.BACKUP_TYPE != 'BACKUP SET' \"\n\n// go grab all the database names\ndisplayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\n\ndbnamesList.each { dbname ->\n\tuser = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n\tpass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n\tport = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n\t//attempt to make a connection.\n\tconn = attemptConnection(host, port, dbname, user, pass)\n\n\tif (conn.status == 'success')\n\t{\n\t\tqueryOutput = runQuery(sqlQuery, conn['connection'])\n\n\t\tif (queryOutput.status == \"Success\")\n\t\t{\n\t\t\tqueryOutput[\"data\"].each { data ->\n\t\t\t\tdef wildvalue = dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") + \"||\" + ((data.DEVICE_TYPE ?: \"Unknown\") +\"||\"+ (data.FILE_TYPE ?: \"Unknown\")+\"||\"+(data.BACKUP_TYPE ?: \"Unknown\")).replaceAll(/[:|\\\\|\\s|=]+/,\"_\")\n\n\t\t\t\tprintln \"${wildvalue}.AgeInHours=${data.AGE_IN_HOURS}\"\n\t\t\t\tprintln \"${wildvalue}.Status=${statusTypes.indexOf(data.STATUS)}\"\n\t\t\t\tprintln \"${wildvalue}.Bytes=${data.BYTES}\"\n\t\t\t}\n\t\t}\n\t\t// always close the connection\n\t\tconn.connection.close()\n\t}\n}\n\nreturn 0\n\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n\tdef returnArray = [:]\n\tdef errors = []\n\tdef connComplete\n\tdef db_connection\n\n\ttry\n\t{\n\t\tdef url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n\t\t// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n\t\t// Create a connection to the database.\n\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\tconnComplete = true\n\n\t}\n\tcatch (Exception e)\n\t{\n\t\t// Print out the exception and exit with 1.\n\t\terrors[0] = e.message\n\t\tconnComplete = false\n\t}\n\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n\tif (connComplete == false)\n\t{\n\t\ttry\n\t\t{\n\t\t\turl = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n\t\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\t\tconnComplete = true\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t// Print out the exception and exit with 1.\n\t\t\terrors[1] = e.message\n\t\t\tconnComplete = false\n\t\t}\n\t}\n\n\t// populate the connection and any messages for the return array\n\tif (connComplete == true) {\n\n\t\treturnArray['connection'] = db_connection\n\t\treturnArray['status'] = 'success'\n\t}\n\telse\n\t{\n\t\treturnArray['status'] = 'failed'\n\t\treturnArray['errors'] = errors\n\t}\n\n\treturn returnArray\n}\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\n\t\treturnArray['data'] = conn.rows(sqlQuery)\n\t\treturnArray['status'] = 'Success'\n\t\treturnArray['error'] = ''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\t\treturnArray['data'] = conn.execute(sqlQuery)\n\t\treturnArray['status'] = \"Success\"\n\t\treturnArray['error']=''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}"}, "datapoints": [{"name": "AgeInHours", "description": "The number of hours since the last backup of this file.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.AgeInHours", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Size", "description": "Size of the file (in bytes).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Bytes", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Status", "description": "The current status of the backup:\n\n0=AVAILABLE\n1=EXPIRED\n2=UNAVAILABLE\n3=OTHER", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Status", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Backup Age", "title": "Backup Age", "verticalLabel": "hours", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "HoursSinceLastBackup", "datapointName": "AgeInHours", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Age", "color": "orange2", "datapointName": "HoursSinceLastBackup", "isVirtual": false}]}, {"name": "Backup Status", "title": "Backup Status", "verticalLabel": "status code", "min": -1.0, "max": 4.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "blue", "datapointName": "Status", "isVirtual": false}]}, {"name": "Size", "title": "Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "Size", "datapointName": "Size", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Size", "color": "olive", "datapointName": "Size", "isVirtual": false}]}]}

×DataSource: Oracle_Database_RMANLatestBackupJobByType (922)

{"name": "Oracle_Database_RMANLatestBackupJobByType", "description": "Information about the latest RMAN Jobs", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "database,oracle,rman,db,backups", "technicalNotes": "For additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle Backup and Recovery Latest Backup Job by Type", "collectionInterval": "15m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef queryOutput = [:]\ndef conn = [:]\ndef dbnamesList = []\n\nsqlQuery = 'SELECT nvl(OUTPUT_DEVICE_TYPE,\\'Unknown_Device\\') as OUTPUT_DEVICE_TYPE, nvl(INPUT_TYPE, \\'Unknown_Device\\') as INPUT_TYPE\\n' +\n', max(START_TIME) as max_time FROM V$RMAN_BACKUP_JOB_DETAILS\\n' +\n'group by nvl(OUTPUT_DEVICE_TYPE,\\'Unknown_Device\\'), nvl(INPUT_TYPE, \\'Unknown_Device\\') '\n\n// go grab all the database names\ndisplayName = hostProps.get(\"system.displayname\")\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\n\ndbnamesList.each { dbname ->\n\tuser = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n\tpass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n\tport = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n\t//attempt to make a connection.\n\tconn = attemptConnection(host, port, dbname, user, pass)\n\n\tif (conn.status == 'success')\n\t{\n\t\tqueryOutput = runQuery(sqlQuery, conn['connection'])\n\n\t\tif (queryOutput.status == \"Success\")\n\t\t{\n\t\t\tqueryOutput[\"data\"].each { data ->\n\t\t\t\tdef wildvalue = dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") + \"||\" + (data.OUTPUT_DEVICE_TYPE +\"_\"+ data.INPUT_TYPE).replaceAll(/[:|\\\\|\\s|=]+/,\"_\")\n\t\t\t\tdef wildalias = (data.OUTPUT_DEVICE_TYPE +\"->\"+ data.INPUT_TYPE).replaceAll(/[:|\\\\|\\s|=]+/,\"_\") + \" (\" + dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") +\")\"\n\t\t\t\tdef autoProps = []\n\t\t\t\tautoProps.push(\"auto.databasename=\"+dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\"))\n\t\t\t\tprintln \"${wildvalue}##${wildalias}######${autoProps.join('&')}\"\n\t\t\t}\n\t\t}\n\t\t// always close the connection\n\t\tconn.connection.close()\n\t}\n}\n\nreturn 0\n\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n\tdef returnArray = [:]\n\tdef errors = []\n\tdef connComplete\n\tdef db_connection\n\n\ttry\n\t{\n\t\tdef url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n\t\t// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n\t\t// Create a connection to the database.\n\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\tconnComplete = true\n\n\t}\n\tcatch (Exception e)\n\t{\n\t\t// Print out the exception and exit with 1.\n\t\terrors[0] = e.message\n\t\tconnComplete = false\n\t}\n\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n\tif (connComplete == false)\n\t{\n\t\ttry\n\t\t{\n\t\t\turl = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n\t\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\t\tconnComplete = true\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t// Print out the exception and exit with 1.\n\t\t\terrors[1] = e.message\n\t\t\tconnComplete = false\n\t\t}\n\t}\n\n\t// populate the connection and any messages for the return array\n\tif (connComplete == true) {\n\n\t\treturnArray['connection'] = db_connection\n\t\treturnArray['status'] = 'success'\n\t}\n\telse\n\t{\n\t\treturnArray['status'] = 'failed'\n\t\treturnArray['errors'] = errors\n\t}\n\n\treturn returnArray\n}\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\n\t\treturnArray['data'] = conn.rows(sqlQuery)\n\t\treturnArray['status'] = 'Success'\n\t\treturnArray['error'] = ''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\t\treturnArray['data'] = conn.execute(sqlQuery)\n\t\treturnArray['status'] = \"Success\"\n\t\treturnArray['error']=''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef queryOutput = [:]\ndef conn = [:]\ndef statusTypes = [\"RUNNING\",\"COMPLETED\",\"RUNNING WITH WARNINGS\",\"RUNNING WITH ERRORS\",\"COMPLETED WITH WARNINGS\",\"COMPLETED WITH ERRORS\",\"FAILED\"]\ndef dbnamesList = []\n\nsqlQuery =\n'SELECT START_TIME, END_TIME, nvl(a.INPUT_TYPE, \\'Unknown\\') as INPUT_TYPE, nvl(a.OUTPUT_DEVICE_TYPE,\\'Unknown\\') as OUTPUT_DEVICE_TYPE ,' +\n' round(ELAPSED_SECONDS,3) as ELAPSED_SECONDS, round(COMPRESSION_RATIO,3) COMPRESSION_RATIO, INPUT_BYTES, OUTPUT_BYTES, round(INPUT_BYTES_PER_SEC,0) INPUT_BYTES_PER_SEC ,' +\n' STATUS, round(OUTPUT_BYTES_PER_SEC ,0) OUTPUT_BYTES_PER_SEC , ROUND(((select CURRENT_DATE from dual) - END_TIME) * 24,2) as AGE_IN_HOURS ' +\n' FROM V$RMAN_BACKUP_JOB_DETAILS a\\n' +\n' inner join \\n' +\n' (SELECT nvl(OUTPUT_DEVICE_TYPE,\\'Unknown\\') as OUTPUT_DEVICE_TYPE, nvl(INPUT_TYPE, \\'Unknown\\') as INPUT_TYPE, ' +\n' max(START_TIME) as max_time FROM V$RMAN_BACKUP_JOB_DETAILS\\n' +\n' group by nvl(OUTPUT_DEVICE_TYPE,\\'Unknown\\'), nvl(INPUT_TYPE, \\'Unknown\\') )q\\n' +\n' on nvl(a.INPUT_TYPE, \\'Unknown\\') = q.INPUT_TYPE and nvl(a.OUTPUT_DEVICE_TYPE,\\'Unknown\\') = q.OUTPUT_DEVICE_TYPE\\n' +\n' and a.START_TIME = q.MAX_TIME'\n\n// go grab all the database names\ndisplayName = hostProps.get(\"system.displayname\")\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\n\ndbnamesList.each { dbname ->\n\tuser = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n\tpass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n\tport = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n\t//attempt to make a connection.\n\tconn = attemptConnection(host, port, dbname, user, pass)\n\n\tif (conn.status == 'success')\n\t{\n\t\tqueryOutput = runQuery(sqlQuery, conn['connection'])\n\n\t\tif (queryOutput.status == \"Success\")\n\t\t{\n\t\t\tqueryOutput[\"data\"].each { data ->\n\t\t\t\tdef wildvalue = dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") + \"||\" + (data.OUTPUT_DEVICE_TYPE +\"_\"+ data.INPUT_TYPE).replaceAll(/[:|\\\\|\\s|=]+/,\"_\")\n\t\t\t\t// print out the status\n\t\t\t\tprintln \"${wildvalue}.AgeInHours= ${data.AGE_IN_HOURS}\"\n\t\t\t\tprintln \"${wildvalue}.Status=${statusTypes.indexOf(data.STATUS)}\"\n\t\t\t\tprintln \"${wildvalue}.ElapsedSeconds=${data.ELAPSED_SECONDS}\"\n\t\t\t\tprintln \"${wildvalue}.CompressionRatio=${data.COMPRESSION_RATIO}\"\n\t\t\t\tprintln \"${wildvalue}.InputBytes=${data.INPUT_BYTES}\"\n\t\t\t\tprintln \"${wildvalue}.OutputBytes=${data.OUTPUT_BYTES}\"\n\t\t\t\tprintln \"${wildvalue}.InputBytesPerSec=${data.INPUT_BYTES_PER_SEC}\"\n\t\t\t\tprintln \"${wildvalue}.OutputBytesPerSec=${data.OUTPUT_BYTES_PER_SEC}\"\n\t\t\t}\n\t\t}\n\t\t// always close the connection\n\t\tconn.connection.close()\n\t}\n}\n\nreturn 0\n\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n\tdef returnArray = [:]\n\tdef errors = []\n\tdef connComplete\n\tdef db_connection\n\n\ttry\n\t{\n\t\tdef url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n\t\t// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n\t\t// Create a connection to the database.\n\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\tconnComplete = true\n\n\t}\n\tcatch (Exception e)\n\t{\n\t\t// Print out the exception and exit with 1.\n\t\terrors[0] = e.message\n\t\tconnComplete = false\n\t}\n\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n\tif (connComplete == false)\n\t{\n\t\ttry\n\t\t{\n\t\t\turl = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n\t\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\t\tconnComplete = true\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t// Print out the exception and exit with 1.\n\t\t\terrors[1] = e.message\n\t\t\tconnComplete = false\n\t\t}\n\t}\n\n\t// populate the connection and any messages for the return array\n\tif (connComplete == true) {\n\n\t\treturnArray['connection'] = db_connection\n\t\treturnArray['status'] = 'success'\n\t}\n\telse\n\t{\n\t\treturnArray['status'] = 'failed'\n\t\treturnArray['errors'] = errors\n\t}\n\n\treturn returnArray\n}\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\n\t\treturnArray['data'] = conn.rows(sqlQuery)\n\t\treturnArray['status'] = 'Success'\n\t\treturnArray['error'] = ''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\t\treturnArray['data'] = conn.execute(sqlQuery)\n\t\treturnArray['status'] = \"Success\"\n\t\treturnArray['error']=''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}"}, "datapoints": [{"name": "AgeInHours", "description": "The number of hours since the job last completed.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.AgeInHours", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CompressionRatio", "description": "The number of times smaller the output file is.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CompressionRatio", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ElapsedSeconds", "description": "The number of seconds the job took.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ElapsedSeconds", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "InputBytes", "description": "The number of bytes input in the job.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.InputBytes", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "InputBytesPerSec", "description": "The number of input bytes processed per second in the job.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.InputBytesPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OutputBytes", "description": "The number of bytes output in the job.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.OutputBytes", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OutputBytesPerSec", "description": "The number of output bytes processed per second in the job.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.OutputBytesPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Status", "description": "The current status of the backup:\n\n0=RUNNING\n1=COMPLETED\n2=RUNNING WITH WARNINGS\n3=RUNNING WITH ERRORS\n4=COMPLETED WITH WARNINGS\n5=COMPLETED WITH ERRORS\n6=FAILED", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Status", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Age", "title": "Age", "verticalLabel": "hours", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AgeInHours", "datapointName": "AgeInHours", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Age", "color": "orange2", "datapointName": "AgeInHours", "isVirtual": false}]}, {"name": "Compression Ratio", "title": "Compression Ratio", "verticalLabel": "ratio", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CompressionRatio", "datapointName": "CompressionRatio", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Compression", "color": "lime", "datapointName": "CompressionRatio", "isVirtual": false}]}, {"name": "Size", "title": "Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "InputBytes", "datapointName": "InputBytes", "consolidationFn": "average"}, {"name": "OutputBytes", "datapointName": "OutputBytes", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Input", "color": "gray", "datapointName": "InputBytes", "isVirtual": false}, {"type": "area", "legend": "Output", "color": "olive", "datapointName": "OutputBytes", "isVirtual": false}]}, {"name": "Status", "title": "Status", "verticalLabel": "status code", "min": -1.0, "max": 7.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "blue", "datapointName": "Status", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "InputBytes", "datapointName": "InputBytesPerSec", "consolidationFn": "average"}, {"name": "OutputBytes", "datapointName": "OutputBytesPerSec", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Input", "color": "aqua", "datapointName": "InputBytes", "isVirtual": false}, {"type": "line", "legend": "Output", "color": "lime", "datapointName": "OutputBytes", "isVirtual": false}]}, {"name": "Time Taken", "title": "Time Taken", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ElapsedSeconds", "datapointName": "ElapsedSeconds", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Duration", "color": "yellow", "datapointName": "ElapsedSeconds", "isVirtual": false}]}]}

×DataSource: Oracle_Database_ResourceLimits (921)

{"name": "Oracle_Database_ResourceLimits", "description": "displays information about global resource use for some of the system resources", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "cache,database,oracle,application", "technicalNotes": "For additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle DB Resource Limits", "collectionInterval": "2m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "\n\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef wildvalue = \"\"\ndef wildAlias = \"\"\ndef ILP = \"\"\n\ndef queryOutput = [:]\ndef conn = [:]\n\n//sqlQuery used to grab resource names\nsqlQuery =\n\"\"\"select distinct resource_name as NAME \n from v\\$resource_limit\n WHERE LTRIM(limit_value) NOT IN ('0', 'UNLIMITED') \"\"\"\n\n// go grab all the database names\ndisplayName = hostProps.get(\"system.displayname\")\nList dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList += dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList += dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList += dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList +=dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (!dbnamesList)\n{\n return 0\n}\n\ndbnamesList.each { dbname ->\n user = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n pass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n port = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n //attempt to make a connection.\n conn = attemptConnection(host, port, dbname, user, pass)\n\n if (conn.status == 'success')\n {\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n queryOutput[\"data\"].each { data ->\n wildvalue = \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}||${data.NAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n wildAlias = \"${data.NAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")} (${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")})\"\n ILP = \"auto.databasename=${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n\n println \"${wildvalue}##${wildAlias}######${ILP}\"\n }\n }\n conn.connection.close()\n }\n}\n\nreturn 0\n\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete = false\n def url =''\n\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n}\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn)\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = db_connection.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = db_connection.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\n\ndef queryOutput = [:]\ndef conn = [:]\n\n//name = 'logicmon'\n// Construct the URL.\n\nsqlQuery = \"\"\"SELECT\n resource_name NAME,\n current_utilization,\n max_utilization,\n initial_allocation,\n limit_value,\n ROUND (100 * DECODE (TRIM (initial_allocation), 'UNLIMITED', 0, '0', 0, current_utilization / initial_allocation), 3) AS CurrentPercentInitialAlloc,\n ROUND (100 * DECODE (TRIM (limit_value), 'UNLIMITED', 0, '0', 0, current_utilization / limit_value), 3) AS CurrentPercentLimit\nFROM v\\$resource_limit\nWHERE LTRIM(limit_value) NOT IN ('0', 'UNLIMITED')\"\"\"\n\n// go grab all the database names\ndisplayName = hostProps.get(\"system.displayname\")\nList dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList += dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList += dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList += dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList +=dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (!dbnamesList)\n{\n return 0\n}\n\ndbnamesList.each { dbname ->\n def user = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n def pass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n def port = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n //attempt to make a connection.\n conn = attemptConnection(host, port, dbname, user, pass)\n\n if (conn.status == 'success')\n {\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n queryOutput[\"data\"].each { data ->\n def wildvalue = \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}||${data.NAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n\n println \"${wildvalue}.current_utilization=${data.current_utilization.toString().trim()}\"\n println \"${wildvalue}.max_utilization =${data.max_utilization.toString().trim() }\"\n println \"${wildvalue}.initial_allocation=${data.initial_allocation.toString().trim()}\"\n println \"${wildvalue}.limit_value=${data.limit_value.toString().trim()}\"\n println \"${wildvalue}.CurrentPercentLimit=${data.CurrentPercentLimit.toString().trim()}\"\n println \"${wildvalue}.CurrentPercentInitialAlloc=${data.CurrentPercentInitialAlloc.toString().trim()}\"\n }\n }\n conn.connection.close()\n }\n}\n\nreturn 0\n\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete = false\n def url =''\n\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n}\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn)\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = db_connection.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = db_connection.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "datapoints": [{"name": "currentPercentInitialAlloc", "description": "Percentage current usage is of initial allocation. Will be 0 if initial alloc is 0. Can be > 100.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentPercentInitialAlloc", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "currentPercentLimit", "description": "Percent current utilization of the limit. Will be 0 if there's no limit.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CurrentPercentLimit", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "currentUtilization", "description": "Number of (resources, locks, or processes) currently being used", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CURRENT_UTILIZATION", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "initialAllocation", "description": "Initial allocation. This will be equal to the value specified for the resource in the initialization parameter file.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.INITIAL_ALLOCATION", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "limitValue", "description": "Unlimited for resources and locks. This can be greater than the initial allocation value.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.LIMIT_VALUE", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxUtilization", "description": "Maximum consumption of this resource since the last instance start-up", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.MAX_UTILIZATION", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Current Percent of Initial Allocation", "title": "Current Percent of Initial Allocation", "verticalLabel": "%", "min": 0.0, "displayPriority": 40, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "currentPercentInitialAlloc", "datapointName": "currentPercentInitialAlloc", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Current Percent of Initial Allocation", "color": "yellow", "datapointName": "currentPercentInitialAlloc", "isVirtual": false}]}, {"name": "Current Percent of Limit", "title": "Current Percent of Limit", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 30, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "currentPercentLimit", "datapointName": "currentPercentLimit", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Current Percentage of the Resource Limit", "color": "silver", "datapointName": "currentPercentLimit", "isVirtual": false}]}, {"name": "Utilization", "title": "Utilization", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "currentUtilization", "datapointName": "currentUtilization", "consolidationFn": "average"}, {"name": "initialAllocation", "datapointName": "initialAllocation", "consolidationFn": "average"}, {"name": "limitValue", "datapointName": "limitValue", "consolidationFn": "average"}, {"name": "maxUtilization", "datapointName": "maxUtilization", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Current Utilization", "color": "lime", "datapointName": "currentUtilization", "isVirtual": false}, {"type": "line", "legend": "initialAllocation", "color": "aqua", "datapointName": "initialAllocation", "isVirtual": false}, {"type": "line", "legend": "limitValue", "color": "red1", "datapointName": "limitValue", "isVirtual": false}, {"type": "line", "legend": "Maximum Utilization", "color": "black", "datapointName": "maxUtilization", "isVirtual": false}]}], "overviewGraphs": [{"name": "Current Percent Of Limit", "title": "Current Percent Of Limit", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "currentPercentLimit", "datapointName": "currentPercentLimit", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Current as Percent of Limit", "color": "silver", "datapointName": "currentPercentLimit", "isVirtual": false}]}]}

×DataSource: Oracle_Database_SessionsWaiting_LockRelease (920)

{"name": "Oracle_Database_SessionsWaiting_LockRelease", "description": "The number of session blocked by another session with locks on a table, schema or database.", "appliesTo": "hasCategory(\"OracleDB\")", "searchKeywords": "sessions,database,oracle,block", "technicalNotes": "The Oracle user needs read only access to the V$SESSIONS view in the database.\nFor additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle Sessions Waiting Lock Release", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef displayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\ndbnamesList.each{dbname->\n //regex removes any invalid characters in the list\n println \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}##${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}######auto.oracle.dbname=${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n}\n\nreturn 0"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n */\nimport groovy.sql.Sql\n\n// Set host variables.\ndef databaseName = instanceProps.get(\"wildvalue\")\n\ndef host = hostProps.get(\"system.hostname\")\n//check to see if this database has a specified username, password and port. If not use the jdbc password\ndef user = hostProps.get(\"oracle.${databaseName.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\ndef pass = hostProps.get(\"oracle.${databaseName.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\ndef port = hostProps.get(\"oracle.${databaseName.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\ndef queryOutput = [:]\ndef conn = [:]\n\n// create the query to get all the stats\nsqlQuery = \"\"\"select count(*) as COUNT \n from v\\$lock l1, v\\$session s1, v\\$lock l2, v\\$session s2 \n where s1.sid = l1.sid and s2.sid = l2.sid \n and l1.BLOCK = 1 and l2.request > 0 and l1.id1 = l2.id1 and l2.id2 = l2.id2\n \"\"\"\n\n//attempt to make a connection.\nconn = attemptConnection(host, port, databaseName, user, pass)\n\nif (conn.status == 'success')\n{\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n queryOutput[\"data\"].each{data->\n\n println \"${databaseName}.COUNT=${data[\"COUNT\"].toString()}\"\n }\n }\n}\n\n// always close the connection\nif (conn['status'] == 'Success')\n{\n conn[0].close()\n}\n\n//print out the database name for debugging.\nprintln \"${databaseName}.instanceName=${databaseName}\"\n\nreturn 0\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "datapoints": [{"name": "sessions", "description": "Number of sessions blocked by other sessions.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.COUNT", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0 20", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "The host ##HOST## has ##VALUE## locked sessions, putting the host in a ##LEVEL## level. This started at ##START##, or ##DURATION## ago."}], "graphs": [{"name": "Sessions waiting on Lock Release", "title": "Sessions waiting on Lock Release", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "sessions", "datapointName": "sessions", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Sessions Waiting", "color": "red", "datapointName": "sessions", "isVirtual": false}]}], "overviewGraphs": [{"name": "Oracle Databases by Session Waiting Lock Release", "title": "Oracle Databases by Session Waiting Lock Release", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "sessions", "datapointName": "sessions", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE## Sessions Waiting for Release", "color": "silver", "datapointName": "sessions", "isVirtual": false}]}]}

×DataSource: Oracle_Database_RMANBackupAsyncIOByType (926)

{"name": "Oracle_Database_RMANBackupAsyncIOByType", "description": "Performance information about ongoing and recently completed RMAN backups and restores.", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "database,oracle,asyncio,rman,db,backups", "technicalNotes": "Only looks at the latest data from the database. The SQL query is a bit complex.\nFor additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle Backup and Recovery Async I/O by Type", "collectionInterval": "15m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef queryOutput = [:]\ndef conn = [:]\n\nsqlQuery = \"select distinct a.TYPE, a.DEVICE_TYPE \" +\n\"from (SELECT TYPE, DEVICE_TYPE FROM V\\$BACKUP_ASYNC_IO \" +\n\" WHERE OPEN_TIME IS NOT NULL) a \"\n\n// go grab all the database names\ndisplayName = hostProps.get(\"system.displayname\")\ndef\tdbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\n\ndbnamesList.each { dbname ->\n\n\tuser = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n\tpass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n\tport = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n\t//attempt to make a connection.\n\tconn = attemptConnection(host, port, dbname, user, pass)\n\n\tif (conn.status == 'success')\n\t{\n\t\tqueryOutput = runQuery(sqlQuery, conn['connection'])\n\n\t\tif (queryOutput.status == \"Success\")\n\t\t{\n\t\t\tqueryOutput[\"data\"].each { data ->\n\n\t\t\t\tdef wildvalue = dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") + \"||\" + (data.TYPE ?: \"Unknown\").replaceAll(/[:|\\\\|\\s|=]+/,\"_\")+ \"||\" + (data.DEVICE_TYPE ?: \"Unknown\").replaceAll(/[:|\\\\|\\s|=]+/,\"_\")\n\t\t\t\tdef wildalias = (data.TYPE ?: \"Unknown\").replaceAll(/[:|\\\\|\\s|=]+/,\"_\")+ \"->\" + (data.DEVICE_TYPE ?: \"Unknown\").replaceAll(/[:|\\\\|\\s|=]+/,\"_\") + \" (\" + dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") +\")\"\n\t\t\t\tdef autoProps = []\n\t\t\t\tautoProps.push(\"auto.databasename=\"+dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\"))\n\n\t\t\t\tprintln \"${wildvalue}##${wildalias}######${autoProps.join('&')}\"\n\t\t\t}\n\t\t}\n\t\t// always close the connection\n\t\tconn.connection.close()\n\t}\n}\n\nreturn 0\n\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n\tdef returnArray = [:]\n\tdef errors = []\n\tdef connComplete\n\tdef db_connection\n\n\ttry\n\t{\n\t\tdef url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n\t\t// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n\t\t// Create a connection to the database.\n\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\tconnComplete = true\n\n\t}\n\tcatch (Exception e)\n\t{\n\t\t// Print out the exception and exit with 1.\n\t\terrors[0] = e.message\n\t\tconnComplete = false\n\t}\n\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n\tif (connComplete == false)\n\t{\n\t\ttry\n\t\t{\n\t\t\turl = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n\t\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\t\tconnComplete = true\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t// Print out the exception and exit with 1.\n\t\t\terrors[1] = e.message\n\t\t\tconnComplete = false\n\t\t}\n\t}\n\n\t// populate the connection and any messages for the return array\n\tif (connComplete == true) {\n\n\t\treturnArray['connection'] = db_connection\n\t\treturnArray['status'] = 'success'\n\t}\n\telse\n\t{\n\t\treturnArray['status'] = 'failed'\n\t\treturnArray['errors'] = errors\n\t}\n\n\treturn returnArray\n}\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\n\t\treturnArray['data'] = conn.rows(sqlQuery)\n\t\treturnArray['status'] = 'Success'\n\t\treturnArray['error'] = ''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\t\treturnArray['data'] = conn.execute(sqlQuery)\n\t\treturnArray['status'] = \"Success\"\n\t\treturnArray['error']=''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef queryOutput = [:]\ndef conn = [:]\n\nsqlQuery = 'SELECT\\n' +\n' a.OPEN_TIME,\\n' +\n' a.TYPE,\\n' +\n' a.DEVICE_TYPE,\\n' +\n' IO_COUNT,\\n' +\n' EFFECTIVE_BYTES_PER_SECOND,\\n' +\n' BYTES,\\n' +\n' TOTAL_BYTES,\\n' +\n' BUFFER_SIZE,\\n' +\n' BUFFER_COUNT,\\n' +\n' ELAPSED_TIME,\\n' +\n' SHORT_WAITS,\\n' +\n' SHORT_WAIT_TIME_TOTAL,\\n' +\n' SHORT_WAIT_TIME_MAX,\\n' +\n' LONG_WAITS,\\n' +\n' LONG_WAIT_TIME_TOTAL,\\n' +\n' LONG_WAIT_TIME_MAX,\\n' +\n' ROUND(((SELECT\\n' +\n' CURRENT_DATE\\n' +\n' FROM dual)\\n' +\n' - a.OPEN_TIME) * 24, 2) AS AGE_IN_HOURS\\n' +\n'FROM V$BACKUP_ASYNC_IO a\\n' +\n'INNER JOIN (SELECT\\n' +\n' MAX(OPEN_TIME) AS MAX_TIME,\\n' +\n' TYPE,\\n' +\n' DEVICE_TYPE\\n' +\n'FROM V$BACKUP_ASYNC_IO\\n' +\n'WHERE OPEN_TIME IS NOT NULL\\n' +\n'GROUP BY TYPE,\\n' +\n' DEVICE_TYPE) q\\n' +\n' ON a.OPEN_TIME = q.MAX_TIME\\n' +\n' AND a.TYPE = q.TYPE\\n' +\n' AND a.DEVICE_TYPE = q.DEVICE_TYPE'\n\n// go grab all the database names\ndisplayName = hostProps.get(\"system.displayname\")\ndbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\n\ndbnamesList.each { dbname ->\n\tuser = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n\tpass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n\tport = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n\t//attempt to make a connection.\n\tconn = attemptConnection(host, port, dbname, user, pass)\n\n\tif (conn.status == 'success')\n\t{\n\t\tqueryOutput = runQuery(sqlQuery, conn['connection'])\n\t\tif (queryOutput.status == \"Success\")\n\t\t{\n\t\t\tqueryOutput[\"data\"].each { data ->\n\n\t\t\t\tdef wildvalue = dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") + \"||\" + (data.TYPE ?: \"Unknown\").replaceAll(/[:|\\\\|\\s|=]+/,\"_\")+ \"||\" + (data.DEVICE_TYPE ?: \"Unknown\").replaceAll(/[:|\\\\|\\s|=]+/,\"_\")\n\t\t\t\tprintln \"${wildvalue}.IOCount=${data.IO_COUNT}\"\n\t\t\t\tprintln \"${wildvalue}.EffectiveBytesPerSecond=${data.EFFECTIVE_BYTES_PER_SECOND}\"\n\t\t\t\tprintln \"${wildvalue}.Bytes=${data.BYTES}\"\n\t\t\t\tprintln \"${wildvalue}.TotalBytes=${data.TOTAL_BYTES}\"\n\t\t\t\tprintln \"${wildvalue}.BufferSize=${data.BUFFER_SIZE}\"\n\t\t\t\tprintln \"${wildvalue}.BufferCount=${data.BUFFER_COUNT}\"\n\t\t\t\tprintln \"${wildvalue}.ElapsedTime=${data.ELAPSED_TIME / 100}\"\n\t\t\t\tprintln \"${wildvalue}.ShortWaits=${data.SHORT_WAITS}\"\n\t\t\t\tprintln \"${wildvalue}.ShortWaitTimeTotal=${data.SHORT_WAIT_TIME_TOTAL / 100}\"\n\t\t\t\tprintln \"${wildvalue}.ShortWaitTimeMax=${data.SHORT_WAIT_TIME_MAX / 100}\"\n\t\t\t\tprintln \"${wildvalue}.LongWaits=${data.LONG_WAITS}\"\n\t\t\t\tprintln \"${wildvalue}.LongWaitTimeTotal=${data.LONG_WAIT_TIME_TOTAL / 100}\"\n\t\t\t\tprintln \"${wildvalue}.LongWaitTimeMax=${data.LONG_WAIT_TIME_MAX / 100}\"\n\t\t\t\tprintln \"${wildvalue}.AgeInHours=${data.AGE_IN_HOURS}\"\n\t\t\t}\n\t\t}\n\t\t// always close the connection\n\t\tconn.connection.close()\n\t}\n}\n\nreturn 0\n\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n\tdef returnArray = [:]\n\tdef errors = []\n\tdef connComplete\n\tdef db_connection\n\n\ttry\n\t{\n\t\tdef url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n\t\t// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n\t\t// Create a connection to the database.\n\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\tconnComplete = true\n\n\t}\n\tcatch (Exception e)\n\t{\n\t\t// Print out the exception and exit with 1.\n\t\terrors[0] = e.message\n\t\tconnComplete = false\n\t}\n\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n\tif (connComplete == false)\n\t{\n\t\ttry\n\t\t{\n\t\t\turl = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n\t\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\t\tconnComplete = true\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t// Print out the exception and exit with 1.\n\t\t\terrors[1] = e.message\n\t\t\tconnComplete = false\n\t\t}\n\t}\n\n\t// populate the connection and any messages for the return array\n\tif (connComplete == true) {\n\n\t\treturnArray['connection'] = db_connection\n\t\treturnArray['status'] = 'success'\n\t}\n\telse\n\t{\n\t\treturnArray['status'] = 'failed'\n\t\treturnArray['errors'] = errors\n\t}\n\n\treturn returnArray\n}\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\n\t\treturnArray['data'] = conn.rows(sqlQuery)\n\t\treturnArray['status'] = 'Success'\n\t\treturnArray['error'] = ''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\t\treturnArray['data'] = conn.execute(sqlQuery)\n\t\treturnArray['status'] = \"Success\"\n\t\treturnArray['error']=''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}"}, "datapoints": [{"name": "AgeInHours", "description": "The number of hours since the backup started.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.AgeInHours", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BufferCount", "description": "The number of buffers being used to read/write this file.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.BufferCount", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BufferSize", "description": "The size of the buffers being used to read/write this file, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.BufferSize", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Bytes", "description": "The number of bytes read or written so far.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Bytes", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "EffectiveBytesPerSecond", "description": "The I/O rate that was achieved with this device during this backup", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.EffectiveBytesPerSecond", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ElapsedTime", "description": "Time, in seconds, that the file was open.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ElapsedTime", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IOCount", "description": "The number of I/Os that were performed to this file.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.IOCount", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "LongWaitTimeMax", "description": "The maximum time taken for a blocking wait for I/O completion, in seconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.LongWaitTimeMax", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "LongWaitTimeTotal", "description": "The total time, in seconds, taken by blocking waits for I/O completion.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.LongWaitTimeTotal", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "LongWaits", "description": "The number of times that a buffer was not immediately available, and only became available after a blocking wait was issued.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.LongWaits", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ShortWaitTimeMax", "description": "Maximum time taken for a non-blocking poll for I/O completion, in seconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ShortWaitTimeMax", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ShortWaitTimeTotal", "description": "Total time, in seconds, taken by non-blocking polls for I/O completion.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ShortWaitTimeTotal", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ShortWaits", "description": "Number of times that a buffer was not immediately available, but a buffer became available after doing a non-blocking poll for I/O completion.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ShortWaits", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalBytes", "description": "The total number of bytes that will be read or written for this file, if known. If not known, this column will be null.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.TotalBytes", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Age", "title": "Age", "verticalLabel": "hours", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AgeInHours", "datapointName": "AgeInHours", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Age", "color": "orange2", "datapointName": "AgeInHours", "isVirtual": false}]}, {"name": "Buffer Count", "title": "Buffer Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 70, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "BufferCount", "datapointName": "BufferCount", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Buffer", "color": "navy", "datapointName": "BufferCount", "isVirtual": false}]}, {"name": "Buffer Size", "title": "Buffer Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 80, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "BufferSize", "datapointName": "BufferSize", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Buffer", "color": "blue", "datapointName": "BufferSize", "isVirtual": false}]}, {"name": "Elapsed Time", "title": "Elapsed Time", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ElapsedTime", "datapointName": "ElapsedTime", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Elapsed", "color": "orange", "datapointName": "ElapsedTime", "isVirtual": false}]}, {"name": "IO Count", "title": "IO Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 40, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "IOCount", "datapointName": "IOCount", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "IO", "color": "navy", "datapointName": "IOCount", "isVirtual": false}]}, {"name": "Longest Wait Time", "title": "Longest Wait Time", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 55, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "LongWaitTimeMax", "datapointName": "LongWaitTimeMax", "consolidationFn": "average"}, {"name": "ShortWaitTimeMax", "datapointName": "ShortWaitTimeMax", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Long", "color": "purple", "datapointName": "LongWaitTimeMax", "isVirtual": false}, {"type": "line", "legend": "Short", "color": "teal", "datapointName": "ShortWaitTimeMax", "isVirtual": false}]}, {"name": "Size", "title": "Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 25, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "Bytes", "datapointName": "Bytes", "consolidationFn": "average"}, {"name": "TotalBytes", "datapointName": "TotalBytes", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Bytes Written", "color": "olive", "datapointName": "Bytes", "isVirtual": false}, {"type": "line", "legend": "Max", "color": "gray", "datapointName": "TotalBytes", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "EffectiveBytesPerSecond", "datapointName": "EffectiveBytesPerSecond", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Effective", "color": "aqua", "datapointName": "EffectiveBytesPerSecond", "isVirtual": false}]}, {"name": "Total Wait Time", "title": "Total Wait Time", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 60, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "LongWaitTimeTotal", "datapointName": "LongWaitTimeTotal", "consolidationFn": "average"}, {"name": "ShortWaitTimeTotal", "datapointName": "ShortWaitTimeTotal", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Long", "color": "purple", "datapointName": "LongWaitTimeTotal", "isVirtual": false}, {"type": "line", "legend": "Short", "color": "teal", "datapointName": "ShortWaitTimeTotal", "isVirtual": false}]}, {"name": "Waits", "title": "Waits", "verticalLabel": "count", "min": 0.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "LongWaits", "datapointName": "LongWaits", "consolidationFn": "average"}, {"name": "ShortWaits", "datapointName": "ShortWaits", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Long", "color": "fuchsia", "datapointName": "LongWaits", "isVirtual": false}, {"type": "line", "legend": "Short", "color": "aqua", "datapointName": "ShortWaits", "isVirtual": false}]}]}

×DataSource: Oracle_Database_RMANBackupSyncIOByType (925)

{"name": "Oracle_Database_RMANBackupSyncIOByType", "description": "Performance information about ongoing and recently completed RMAN backups and restores", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "database,oracle,rman,db,backups", "technicalNotes": "This Datasource uses table V$BACKUP_SYNC_IO and will only have data in it while there are active or recently complete backups. see https://docs.oracle.com/cd/E11882_01/server.112/e40402/dynviews_1067.htm#REFRN30027\nFor additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle Backup and Recovery Sync I/O by Type", "collectionInterval": "15m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef queryOutput = [:]\ndef conn = [:]\n\nsqlQuery = 'SELECT distinct TYPE, DEVICE_TYPE FROM V$BACKUP_SYNC_IO WHERE OPEN_TIME IS NOT NULL'\n\n// go grab all the database names\ndisplayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\n\ndbnamesList.each { dbname ->\n\tuser = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n\tpass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n\tport = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n\t//attempt to make a connection.\n\tconn = attemptConnection(host, port, dbname, user, pass)\n\n\tif (conn.status == 'success')\n\t{\n\t\tqueryOutput = runQuery(sqlQuery, conn['connection'])\n\n\t\tif (queryOutput.status == \"Success\")\n\t\t{\n\t\t\tqueryOutput[\"data\"].each { data ->\n\t\t\t\tdef wildvalue = dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") + \"||\" + (data.TYPE ?: \"Unknown\").replaceAll(/[:|\\\\|\\s|=]+/,\"_\") + \"||\" + (data.DEVICE_TYPE ?: \"Unknown\").replaceAll(/[:|\\\\|\\s|=]+/,\"_\")\n\t\t\t\tdef wildalias = (data.TYPE ?: \"Unknown\")+\"->\" + (data.DEVICE_TYPE ?: \"Unknown\") + \"(\" + dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") +\")\"\n\t\t\t\tdef autoProps = []\n\t\t\t\tautoProps.push(\"auto.databasename=\"+dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\"))\n\t\t\t\tprintln \"${wildvalue}##${wildalias}######${autoProps.join('&')}\"\n\t\t\t}\n\t\t}\n\t\t// always close the connection\n\t\tconn.connection.close()\n\t}\n}\n\nreturn 0\n\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n\tdef returnArray = [:]\n\tdef errors = []\n\tdef connComplete\n\tdef db_connection\n\n\ttry\n\t{\n\t\tdef url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n\t\t// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n\t\t// Create a connection to the database.\n\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\tconnComplete = true\n\n\t}\n\tcatch (Exception e)\n\t{\n\t\t// Print out the exception and exit with 1.\n\t\terrors[0] = e.message\n\t\tconnComplete = false\n\t}\n\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n\tif (connComplete == false)\n\t{\n\t\ttry\n\t\t{\n\t\t\turl = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n\t\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\t\tconnComplete = true\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t// Print out the exception and exit with 1.\n\t\t\terrors[1] = e.message\n\t\t\tconnComplete = false\n\t\t}\n\t}\n\n\t// populate the connection and any messages for the return array\n\tif (connComplete == true) {\n\n\t\treturnArray['connection'] = db_connection\n\t\treturnArray['status'] = 'success'\n\t}\n\telse\n\t{\n\t\treturnArray['status'] = 'failed'\n\t\treturnArray['errors'] = errors\n\t}\n\n\treturn returnArray\n}\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\n\t\treturnArray['data'] = conn.rows(sqlQuery)\n\t\treturnArray['status'] = 'Success'\n\t\treturnArray['error'] = ''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\t\treturnArray['data'] = conn.execute(sqlQuery)\n\t\treturnArray['status'] = \"Success\"\n\t\treturnArray['error']=''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// no data returned is normal for this datasource. Data should show up when there are hot backups or backups happened now that are synchronous backups.\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef queryOutput = [:]\ndef conn = [:]\n\nsqlQuery = ' select a.OPEN_TIME, a.TYPE, a.DEVICE_TYPE' +\n' , IO_COUNT, IO_TIME_TOTAL, IO_TIME_MAX, DISCRETE_BYTES_PER_SECOND, EFFECTIVE_BYTES_PER_SECOND, BYTES, TOTAL_BYTES, BUFFER_SIZE, BUFFER_COUNT, ' +\n' ROUND(((select CURRENT_DATE from dual) - OPEN_TIME) * 24,2) as AGE_IN_HOURS ' +\n' FROM V$BACKUP_SYNC_IO a ' +\n' inner join ' +\n' (SELECT max(OPEN_TIME) as max_time , TYPE, DEVICE_TYPE FROM V$BACKUP_SYNC_IO WHERE OPEN_TIME IS NOT NULL group by TYPE, DEVICE_TYPE) q' +\n' on a.OPEN_TIME = q.max_time and a.TYPE = q.TYPE and a.DEVICE_TYPE = q.DEVICE_TYPE '\n\n// go grab all the database names\ndisplayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\n\ndbnamesList.each { dbname ->\n\tuser = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n\tpass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n\tport = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n\t//attempt to make a connection.\n\tconn = attemptConnection(host, port, dbname, user, pass)\n\n\tif (conn.status == 'success')\n\t{\n\t\tqueryOutput = runQuery(sqlQuery, conn['connection'])\n\t\tif (queryOutput.status == \"Success\")\n\t\t{\n\t\t\tqueryOutput[\"data\"].each { data ->\n\t\t\t\tdef wildvalue = dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") + \"||\" + (data.TYPE ?: \"Unknown\").replaceAll(/[:|\\\\|\\s|=]+/,\"_\") + \"||\" + (data.DEVICE_TYPE ?: \"Unknown\").replaceAll(/[:|\\\\|\\s|=]+/,\"_\")\n\t\t\t\tprintln \"${wildvalue}.IOCount=${data.IO_COUNT}\"\n\t\t\t\tprintln \"${wildvalue}.IOTimeTotal=${data.IO_TIME_TOTAL / 100}\"\n\t\t\t\tprintln \"${wildvalue}.IOTimeMax=${data.IO_TIME_MAX / 100}\"\n\t\t\t\tprintln \"${wildvalue}.DiscreteBytesPerSecond=${data.DISCRETE_BYTES_PER_SECOND}\"\n\t\t\t\tprintln \"${wildvalue}.EffectiveBytesPerSecond=${data.EFFECTIVE_BYTES_PER_SECOND}\"\n\t\t\t\tprintln \"${wildvalue}.Bytes=${data.BYTES}\"\n\t\t\t\tprintln \"${wildvalue}.TotalBytes=${data.TOTAL_BYTES}\"\n\t\t\t\tprintln \"${wildvalue}.BufferSize=${data.BUFFER_SIZE}\"\n\t\t\t\tprintln \"${wildvalue}.BufferCount=${data.BUFFER_COUNT}\"\n\t\t\t\tprintln \"${wildvalue}.AgeInHours=${data.AGE_IN_HOURS}\"\n\t\t\t}\n\t\t}\n\t\t// always close the connection\n\t\tconn.connection.close()\n\t}\n}\n\nreturn 0\n\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n\tdef returnArray = [:]\n\tdef errors = []\n\tdef connComplete\n\tdef db_connection\n\n\ttry\n\t{\n\t\tdef url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n\t\t// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n\t\t// Create a connection to the database.\n\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\tconnComplete = true\n\n\t}\n\tcatch (Exception e)\n\t{\n\t\t// Print out the exception and exit with 1.\n\t\terrors[0] = e.message\n\t\tconnComplete = false\n\t}\n\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n\tif (connComplete == false)\n\t{\n\t\ttry\n\t\t{\n\t\t\turl = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n\t\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\t\tconnComplete = true\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t// Print out the exception and exit with 1.\n\t\t\terrors[1] = e.message\n\t\t\tconnComplete = false\n\t\t}\n\t}\n\n\t// populate the connection and any messages for the return array\n\tif (connComplete == true) {\n\n\t\treturnArray['connection'] = db_connection\n\t\treturnArray['status'] = 'success'\n\t}\n\telse\n\t{\n\t\treturnArray['status'] = 'failed'\n\t\treturnArray['errors'] = errors\n\t}\n\n\treturn returnArray\n}\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\n\t\treturnArray['data'] = conn.rows(sqlQuery)\n\t\treturnArray['status'] = 'Success'\n\t\treturnArray['error'] = ''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\t\treturnArray['data'] = conn.execute(sqlQuery)\n\t\treturnArray['status'] = \"Success\"\n\t\treturnArray['error']=''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}"}, "datapoints": [{"name": "AgeInHours", "description": "The number of hours since the backup started.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.AgeInHours", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BufferCount", "description": "The number of buffers being used to read/write this file.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.BufferCount", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BufferSize", "description": "The size of the buffers being used to read/write this file, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.BufferSize", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Bytes", "description": "The number of bytes read or written so far.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.Bytes", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiscreteBytesPerSecond", "description": "The average transfer rate for this file.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.DiscreteBytesPerSecond", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "EffectiveBytesPerSecond", "description": "The I/O rate that was achieved with this device during this backup", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.EffectiveBytesPerSecond", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IOCount", "description": "The number of I/Os that were performed to this file.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.IOCount", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IOTimeMax", "description": "The maximum time taken for a single I/O request.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.IOTimeMax", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IOTimeTotal", "description": "The total time, in hundredths of a second, taken to do I/O for this file.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.IOTimeTotal", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalBytes", "description": "The total number of bytes that will be read or written for this file, if known. If not known, this column will be null.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.TotalBytes", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Age", "title": "Age", "verticalLabel": "hours", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AgeInHours", "datapointName": "AgeInHours", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Age", "color": "orange2", "datapointName": "AgeInHours", "isVirtual": false}]}, {"name": "Buffer Count", "title": "Buffer Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 70, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "BufferCount", "datapointName": "BufferCount", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Buffer", "color": "navy", "datapointName": "BufferCount", "isVirtual": false}]}, {"name": "Buffer Size", "title": "Buffer Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 60, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "BufferSize", "datapointName": "BufferSize", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Buffer", "color": "blue", "datapointName": "BufferSize", "isVirtual": false}]}, {"name": "IO Count", "title": "IO Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 40, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "IOCount", "datapointName": "IOCount", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "IO", "color": "navy", "datapointName": "IOCount", "isVirtual": false}]}, {"name": "IO Time Longest Single Request", "title": "IO Time Longest Single Request", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 55, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "IOTimeMax", "datapointName": "IOTimeMax", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Longest ", "color": "red", "datapointName": "IOTimeMax", "isVirtual": false}]}, {"name": "IO Time Taken", "title": "IO Time Taken", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "IOTimeTotal", "datapointName": "IOTimeTotal", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Duration", "color": "yellow", "datapointName": "IOTimeTotal", "isVirtual": false}]}, {"name": "Size", "title": "Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "Bytes", "datapointName": "Bytes", "consolidationFn": "average"}, {"name": "TotalBytes", "datapointName": "TotalBytes", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Written", "color": "olive", "datapointName": "Bytes", "isVirtual": false}, {"type": "area", "legend": "Max", "color": "gray", "datapointName": "TotalBytes", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "DiscreteBytesPerSecond", "datapointName": "DiscreteBytesPerSecond", "consolidationFn": "average"}, {"name": "EffectiveBytesPerSecond", "datapointName": "EffectiveBytesPerSecond", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Discrete", "color": "fuchsia", "datapointName": "DiscreteBytesPerSecond", "isVirtual": false}, {"type": "line", "legend": "Effective", "color": "aqua", "datapointName": "EffectiveBytesPerSecond", "isVirtual": false}]}]}

×DataSource: Oracle_Database_LibraryCache (928)

{"name": "Oracle_Database_LibraryCache", "description": "Information about about library cache performance and activity.", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "cache,database,oracle,application", "technicalNotes": "Works with single or multi database. Needs to have read only access to V$LIBRARYCACHE.\nFor additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle Library Cache", "collectionInterval": "2m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "\n/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef host = hostProps.get(\"system.hostname\")\ndef displayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\ndbnamesList.each{dbname->\n //regex removes any invalid characters in the list\n println \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}##${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}######auto.databasename=${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n}\n\nreturn 0"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n */\n\nimport groovy.sql.Sql\n\n// Set host variables.\ndef databaseName = instanceProps.get(\"wildvalue\")\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"oracle.${databaseName.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\ndef pass = hostProps.get(\"oracle.${databaseName.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\ndef port = hostProps.get(\"oracle.${databaseName.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\ndef queryOutput = [:]\ndef conn = [:]\n\n// create the query to get all the stats\nsqlQuery = \"select sum(PINS) pins, sum(RELOADS) reloads, sum (PINHITS) pinhits from V\\$LIBRARYCACHE\"\n\n//attempt to make a connection.\nconn = attemptConnection(host, port, databaseName, user, pass)\n\nif (conn.status == 'success')\n{\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n queryOutput[\"data\"].each{data->\n\n println \"${databaseName}.pins=${data[\"pins\"].toString()}\"\n println \"${databaseName}.reloads=${data[\"reloads\"].toString()}\"\n println \"${databaseName}.pinhits=${data[\"pinhits\"].toString()}\"\n }\n }\n}\n\n// always close the connection\nif (conn['status'] == 'Success')\n{\n conn[0].close()\n}\n\n//print out the database name for debugging.\nprintln \"${databaseName}.instanceName=${databaseName}\"\n\nreturn 0\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "datapoints": [{"name": "pinhits", "description": "Number of times, per second, all of the metadata pieces of the library object were found in memory", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pinhits", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "pins", "description": "Number of times per second a PIN was requested for objects", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.pins", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "reloads", "description": "Any PIN of an object that is not the first PIN performed since the object handle was created, and which requires loading the object from disk", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.reloads", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "LibraryRatios", "title": "Library Ratios", "verticalLabel": "%", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "pinhits", "datapointName": "pinhits", "consolidationFn": "average"}, {"name": "pins", "datapointName": "pins", "consolidationFn": "average"}, {"name": "reloads", "datapointName": "reloads", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "LibraryCacheHitRatio", "expr": "100*pinhits/pins"}, {"name": "ReloadRatio", "expr": "100*reloads/pins"}], "lines": [{"type": "line", "legend": "LibraryCacheHitRatio", "color": "green", "datapointName": "LibraryCacheHitRatio", "isVirtual": true}, {"type": "line", "legend": "ReloadRatio", "color": "red", "datapointName": "ReloadRatio", "isVirtual": true}]}], "overviewGraphs": [{"name": "Library Ratios", "title": "Library Ratios", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "pinhits", "datapointName": "pinhits", "consolidationFn": "average", "aggregateMethod": "average"}, {"name": "pins", "datapointName": "pins", "consolidationFn": "average", "aggregateMethod": "average"}, {"name": "reloads", "datapointName": "reloads", "consolidationFn": "average", "aggregateMethod": "average"}], "virtualDatapoints": [{"name": "LibraryCacheHitRatio", "expr": "100*pinhits/pins"}, {"name": "ReloadRatio", "expr": "100*reloads/pins"}], "lines": [{"type": "line", "legend": "##INSTANCE## Hit Ratio", "color": "silver", "datapointName": "LibraryCacheHitRatio", "isVirtual": true}, {"type": "line", "legend": "##INSTANCE## Miss Ratio", "color": "silver", "datapointName": "ReloadRatio", "isVirtual": true}]}]}

×DataSource: Oracle_Database_BlockedSessionOverview (930)

{"name": "Oracle_Database_BlockedSessionOverview", "description": "Information on total blocked sessions within the V$SESSIONS table.", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "overview,database,oracle,session", "technicalNotes": "Information on total blocked sessions within the V$SESSIONS table. DB user must have access to V$Sessions view. \nSelect statement used is:\nSELECT COUNT(*) as count from V$SESSION where BLOCKING_SESSION is not NULL\nFor additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle Blocked Sessions Overview", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "\n/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef displayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\ndbnamesList.each{dbname->\n //regex removes any invalid characters in the list\n println \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}##${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}######auto.oracle.dbname=${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n}\n\nreturn 0"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n */\n\nimport groovy.sql.Sql\n\n// Set host variables.\ndef databaseName = instanceProps.get(\"wildvalue\")\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"oracle.${databaseName.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\ndef pass = hostProps.get(\"oracle.${databaseName.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\ndef port = hostProps.get(\"oracle.${databaseName.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\ndef queryOutput = [:]\ndef conn = [:]\n\n// create the query to get all the stats\nsqlQuery = \"SELECT COUNT(*) as count from V\\$SESSION where BLOCKING_SESSION is not NULL\"\n\n//attempt to make a connection.\nconn = attemptConnection(host, port, databaseName, user, pass)\nif (conn.status == 'success')\n{\n queryOutput = runQuery(sqlQuery, conn['connection'])\n if (queryOutput.status == \"Success\")\n {\n queryOutput.data.each{data->\n println \"${databaseName}.BlockedSessions=${data[\"count\"].toString()}\"\n }\n }\n}\n\n// always close the connection\nif (conn.status == 'success')\n{\n conn.connection.close()\n}\n\n//print out the database name for debugging.\nprintln \"${databaseName}.instanceName=${databaseName}\"\n\nreturn 0\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "datapoints": [{"name": "BlockedSessionCount", "description": "The number of sessions with a BLOCKING_SESSION value in the V$SESSION table.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.BlockedSessions", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "Blocking sessions", "alertBody": "The host ##HOST## is reporting ##VALUE## blocking sessions in the V$SESSIONS Table. This started at ##START## and has been an issue for ##DURATION##.\n\nSee the instance level properties in the \"Oracle Blocked Sessions\" datasource for details.\n\nThis error is set to report when Blocked Sessions are >##LEVEL##"}], "graphs": [{"name": "Blocked Sessions", "title": "Blocked Sessions", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BlockedSessionCount", "datapointName": "BlockedSessionCount", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Blocked", "color": "red", "datapointName": "BlockedSessionCount", "isVirtual": false}]}], "overviewGraphs": [{"name": "Blocked Sessions", "title": "Blocked Sessions", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "BlockedSessionCount", "datapointName": "BlockedSessionCount", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE## Blocked", "color": "silver", "datapointName": "BlockedSessionCount", "isVirtual": false}]}]}

×DataSource: Oracle_Database_BlockedSessions (1071)

{"name": "Oracle_Database_BlockedSessions", "description": "Creates an instance for every blocked session on the database.", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "database,processes,oracle", "technicalNotes": "Active discovery and collect must run on the same time sequence, every 15 minutes. Don't try to run collect more frequently than every 15 minutes. It won't work. The DataSource returns the SID for the process that's blocking other processes. Tells the user how long this process has been blocking others. Will alert if the process has been blocking for more than 3 minutes.\nMust have read access to V$SESSIONS and V$SQL system views.", "displayedAs": "Oracle Blocked Sessions", "collectionInterval": "15m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n\n */\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef displayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\ndef dbnames = \"\"\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\ndbnamesList.each { databaseName ->\n\n//check to see if this database has a specified username, password and port. If not use the jdbc password\n def user = hostProps.get(\"oracle.${databaseName.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n def pass = hostProps.get(\"oracle.${databaseName.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n def port = hostProps.get(\"oracle.${databaseName.trim()}.port\") ?: (hostProps.get(\"jdbc.oracle.port\") ?: 1521)\n\n def queryOutput = [:]\n def conn = [:]\n\n// create the query to get all the stats\nsqlQuery = \"\"\"\nSELECT vs.BLOCKING_SESSION, vs.USERNAME, vs.SID, vs.SERIAL#, vs.WAIT_CLASS, vs.MACHINE, vs.TERMINAL, vs.PROGRAM\n , vs.STATUS, vs.SERVER, vs.TYPE , vs.WAIT_TIME, vs.SECONDS_IN_WAIT \n , vs.SQL_ID, vsql.SQL_TEXT\n from V\\$SESSION vs\n inner join v\\$sql vsql on vs.SQL_ID = vsql.SQL_ID\n where BLOCKING_SESSION is not NULL \n order by BLOCKING_SESSION\\\n\"\"\"\n\n//attempt to make a connection.\n conn = attemptConnection(host, port, databaseName, user, pass)\n\n // Create a connection to the SQL server\n\n if (conn.status == 'success')\n {\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n queryOutput.data.each\n {\n output ->\n\n def autoProps = []\n\n output.each\n {\n k, v ->\n\n autoProps.push(\"auto.oracle.process.${k.toString().toLowerCase()}=${URLEncoder.encode(v.toString())}\")\n }\n\t\t\t\t\t\t\tautoProps.push(\"auto.databasename=\"+databaseName.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\"))\n println \"DB_${databaseName}_ProcID_${output['SERIAL#']}##DB_${databaseName}_ProcID_${output['SERIAL#']}######${autoProps.join('&')}\"\n }\n }\n }\n\n// always close the connection\n if (conn['status'] == 'Success')\n {\n conn[0].close()\n }\n}\n\nreturn 0\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nreads instance level properties from the instance and returns this as data. Collect and active discovery must run on the same time interval\nyes, really simple.\n */\ndef instanceName = instanceProps.get(\"wildvalue\")\ndef waitTime = instanceProps.get(\"auto.oracle.process.wait_time\")\ndef secondsInWait = instanceProps.get(\"auto.oracle.process.seconds_in_wait\")\n//def instanceSerialNumber = instanceProps.get(\"auto.oracle.process.serial#\")\n//def sqlText = instanceProps.get(\"auto.oracle.process.sql_text\")\n\nprintln \"${instanceName}.waitTime=${waitTime.toString()}\"\nprintln \"${instanceName}.secondsInWait=${secondsInWait.toString()}\""}, "datapoints": [{"name": "WaitTime", "description": "A nonzero value is the session's last wait time. A zero value means the session is currently waiting.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.waitTime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "secondsInWait", "description": "If waitTime = 0, then secondsInWait is the seconds spent in the current wait condition. If waitTime is 0, then secondsInWait is the seconds since the start of the last wait, and secondsInWait - waitTime / 100 is the active seconds since the last wait ended.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.secondsInWait", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Process Wait Time", "title": "Process Wait Time", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 10, "timeScale": "1hour", "scale1024": false, "rigid": false, "datapoints": [{"name": "WaitTime", "datapointName": "WaitTime", "consolidationFn": "max"}, {"name": "secondsInWait", "datapointName": "secondsInWait", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Wait Time", "color": "aqua", "datapointName": "WaitTime", "isVirtual": false}, {"type": "line", "legend": "Seconds Spent Waiting", "color": "silver", "datapointName": "secondsInWait", "isVirtual": false}]}], "overviewGraphs": [{"name": "Process Wait Time", "title": "Process Wait Time", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 10, "timeScale": "1hour", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "WaitTime", "datapointName": "WaitTime", "consolidationFn": "max", "aggregateMethod": "max"}, {"name": "secondsInWait", "datapointName": "secondsInWait", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE## Wait Time", "color": "silver", "datapointName": "WaitTime", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Seconds spent in Waiting", "color": "silver", "datapointName": "secondsInWait", "isVirtual": false}]}]}

×DataSource: Oracle_Database_IndividualSchemaSize (929)

{"name": "Oracle_Database_IndividualSchemaSize", "description": "The size of the individual schema for each owner.", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "schema,database,oracle,tablespace", "technicalNotes": "For additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle Individual Schema Size", "collectionInterval": "15m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n */\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef wildvalue = \"\"\ndef wildAlias = \"\"\ndef ILP = \"\"\n\ndef queryOutput = [:]\ndef conn = [:]\n\n// go grab all the database names\n\ndisplayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\nsqlQuery = 'SELECT SUM(bytes) as bytes, owner from DBA_SEGMENTS group by owner'\n\ndbnamesList.each { dbname ->\n user = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n pass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n port = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n //attempt to make a connection.\n conn = attemptConnection(host, port, dbname, user, pass)\n\n if (conn.status == 'success')\n {\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n\n queryOutput[\"data\"].each { data ->\n wildvalue = \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}||${data.owner.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n wildAlias = \"${data.owner.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")} (${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")})\"\n ILP = \"auto.databasename=${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n\n println \"${wildvalue}##${wildAlias}######${ILP}\"\n\n\n\n }\n\n }\n\n }\n\n // always close the connection\n if (conn.status == 'success')\n {\n conn.connection.close()\n }\n\n}\n\nreturn 0\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n */\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef wildvalue = \"\"\n\ndef queryOutput = [:]\ndef conn = [:]\n\n// go grab all the database names\ndisplayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\nsqlQuery = 'SELECT SUM(bytes) as bytes, owner from DBA_SEGMENTS group by owner'\n\ndbnamesList.each { dbname ->\n user = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n pass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n port = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n //attempt to make a connection.\n conn = attemptConnection(host, port, dbname, user, pass)\n\n if (conn.status == 'success')\n {\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n\n queryOutput[\"data\"].each { data ->\n wildvalue = \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}||${data.owner.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n println \"${wildvalue}.bytes=${data.bytes}\"\n }\n }\n }\n\n // always close the connection\n if (conn.status == 'success')\n {\n conn.connection.close()\n }\n}\n\nreturn 0\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "datapoints": [{"name": "Bytes", "description": "The total of every segment for the owner in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.bytes", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Schema Size", "title": "Schema Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "Bytes", "datapointName": "Bytes", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Size", "color": "aqua", "datapointName": "Bytes", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Schema by Size", "title": "Top 10 Schema by Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Bytes", "datapointName": "Bytes", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Bytes", "isVirtual": false}]}]}

×DataSource: Oracle_Database_SystemStats (919)

{"name": "Oracle_Database_SystemStats", "description": "Get statistics from Oracle for the database instance.", "appliesTo": "hasCategory(\"OracleDB\")", "searchKeywords": "database,oracle,multi database,statistics", "technicalNotes": "Active discovery will concatenate all database names in the configuration. Should be backward compatible with the old setup. All data is pulled from records in the v$sysstat system view.\nFor additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle System Statistics", "collectionInterval": "3m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "\n/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef displayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\ndbnamesList.each{dbname->\n //regex removes any invalid characters in the list\n println \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}##${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}######auto.oracle.dbname=${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n}\n\nreturn 0"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n */\nimport groovy.sql.Sql\n\n// Set host variables.\ndef databaseName = instanceProps.get(\"wildvalue\")\ndef host = hostProps.get(\"system.hostname\")\n//check to see if this database has a specified username, password and port. If not use the jdbc password\ndef user = hostProps.get(\"oracle.${databaseName.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\ndef pass = hostProps.get(\"oracle.${databaseName.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\ndef port = hostProps.get(\"oracle.${databaseName.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\ndef conn = []\n\n//update this field list to add more fields to this where clause.\n// more Fields can be found on the at select * from v$statname in oracle.\ndef fieldList = [\n \"4017839461\":\"db block gets from cache\",\n \"582481098\":\"user commits\",\n \"2839918855\":\"consistent gets from cache\",\n \"3080465522\":\"logons current\",\n \"916801489\":\"db block changes\",\n \"2533123502\":\"sorts (disk)\",\n \"2453370665\":\"execute count\",\n \"143509059\":\"parse count (hard)\",\n \"3143187968\":\"session logical reads\",\n \"1042655239\":\"table scans (long tables)\",\n \"2263124246\":\"physical reads\",\n \"4171507801\":\"physical reads cache\",\n \"1190468109\":\"physical writes\",\n \"2656001462\":\"recursive calls\",\n \"1985754937\":\"redo log space requests\",\n \"252430928\":\"redo log space wait time\",\n \"1236385760\":\"redo size\",\n \"3671147913\":\"user rollbacks\",\n \"3741388076\":\"table scan blocks gotten\",\n \"2666645286\":\"logons cumulative\",\n \"63887964\":\"parse count (total)\",\n \"2882015696\":\"user calls\"\n]\n\ndef whereClause = \"\\'\"+ fieldList.keySet().join(\"\\', \\'\") +\"\\'\"\n\n// create the query to get all the stats\nsqlQuery = \"SELECT name, value, stat_ID from v\\$sysstat where STAT_ID in (\" + whereClause +\")\"\n\ndef queryOutput = [:]\n//attempt to make a connection.\nconn = attemptConnection(host, port, databaseName, user, pass)\nif (conn.status == 'success')\n{\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n queryOutput[\"data\"].each{data->\n\n println \"${databaseName}.${data[\"STAT_ID\"].toString()}=${data[\"VALUE\"].toString()}\"\n }\n }\n}\n\n// always close the connection\nif (conn['status'] == 'Success')\n{\n conn[0].close()\n}\n\nprintln \"${databaseName}.instanceName=${databaseName}\"\n\nreturn 0\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "datapoints": [{"name": "BlockGetsFromCache", "description": "Number of times a CURRENT block was requested from the buffer cache.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.4017839461", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Commits", "description": "Number of user commits per second.\n\nWhen a user commits a transaction, the redo generated that reflects the changes made to database blocks must be written to disk. Commits often represent the closest thing to a user transaction rate.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.582481098", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ConsistentGetsCache", "description": "Number of times a consistent read was requested for a block from the buffer cache.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.2839918855", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentLogons", "description": "Total number of current logons.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.3080465522", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "DiskSorts", "description": "Number of sort operations that required at least one disk write. \n\nSorts that require I/O to disk are quite resource intensive. Try increasing the size of the initialization parameter SORT_AREA_SIZE.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.2533123502", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "Executes", "description": "Total number of calls (user and recursive) that executed SQL statements.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.2453370665", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "HardParses", "description": "Number of parse calls per second (real parses). A hard parse is a very expensive operation in terms of memory use, because it requires Oracle to allocate a workheap and other memory structures and then build a parse tree.\n\nA hard parse takes place when a SQL statement has to be loaded into the shared pool. In this event, the Oracle Server has to allocate memory in the shared pool and parse the statement.\n\nHigh hard parse rates cause serious performance issues and must be investigated. Usually, a high hard parse rate is accompanied by latch contention on the shared pool and library cache latches. May occur when your shared_pool_size is too small (and reentrant SQL is paged out), or when you have non-reusable SQL statements without host variables.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.143509059", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "threshold": ">= 100", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "Oracle database on ##HOST## is experiencing a large number of hard parse calls, at ##VALUE## / sec , placing the host into ##LEVEL## state.\n\nA hard parse is a very expensive operation in terms of memory use, because it requires Oracle to allocate a workheap and other memory structures and then build a parse tree.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "LogicalReads", "description": "A logical read is a buffer access (normally equated to a consistent get) and indicates that a data block was found in the data buffer avoiding a disk access.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.3143187968", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "LongTableScans", "description": "Long full table scans.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.1042655239", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "PhysicalReads", "description": "Total number of data blocks read from disk.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.2263124246", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "PhysicalReadsCache", "description": "Total number of data blocks read from disk into buffer cache", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.4171507801", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "PhysicalWrites", "description": "Total number of data blocks written to disk.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.1190468109", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "RecursiveCalls", "description": "internal SQL statements triggered to execute a User SQL statement.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.2656001462", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "RedoLogSpaceRequests", "description": "Number of times the active log file is full and Oracle must wait for disk space to be allocated for the redo log entries.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.1985754937", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "RedoLogSpaceWaitTime", "description": "Total elapsed waiting time for \"redo log space requests\" in 10s of milliseconds", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.252430928", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "Oracle database on ##HOST## is having to pause ##VALUE## milliseconds, waiting for disk space to be allocated for redo log entries, placing the host into ##LEVEL## state.\n\nIt may be necessary to increase the redo log buffer if this situation persists.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "RedoSize", "description": "Total amount of redo generated in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.1236385760", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "Rollbacks", "description": "Number of times, per second, users manually issue the ROLLBACK statement or an error occurs during a user's transactions", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.3671147913", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "TableScanBlocksGotten", "description": "The number of blocks encountered during the scan.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.3741388076", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "TotalLogons", "description": "Total number of logons, per second, since the instance started. \n\nUseful only in V$SYSSTAT. It gives an instance overview of all processes that logged on.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.2666645286", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "TotalParses", "description": "Hard plus Soft parses", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.63887964", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "UserCalls", "description": "Incremented for log in, parse, or execute", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.2882015696", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "dbBlockChanges", "description": "The total number of changes that were made to all blocks in the SGA that were part of an update or delete operation. These are changes that are generating redo log entries and hence will be permanent changes to the database if the transaction is committed.\n\nThis statistic is a rough indication of total database work. This statistic indicates (possibly on a per-transaction level) the rate at which buffers are being dirtied.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.916801489", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}], "graphs": [{"name": "Block Changes", "title": "Block Changes", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BlockChanges", "datapointName": "dbBlockChanges", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Block Changes", "color": "silver", "datapointName": "BlockChanges", "isVirtual": false}]}, {"name": "Block Changes Per Transaction", "title": "Block Changes Per Transaction", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BlockChanges", "datapointName": "dbBlockChanges", "consolidationFn": "average"}, {"name": "Commits", "datapointName": "Commits", "consolidationFn": "average"}, {"name": "Rollbacks", "datapointName": "Rollbacks", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Ratio", "expr": "BlockChanges/(Commits+Rollbacks)"}], "lines": [{"type": "area", "legend": "Changes per Transaction", "color": "green", "datapointName": "Ratio", "isVirtual": true}]}, {"name": "Buffer Cache Hit Ratio", "title": "Buffer Cache Hit Ratio", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "CacheGets", "datapointName": "BlockGetsFromCache", "consolidationFn": "average"}, {"name": "ConsistentGets", "datapointName": "ConsistentGetsCache", "consolidationFn": "average"}, {"name": "Reads", "datapointName": "PhysicalReadsCache", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Ratio", "expr": "100*(1-(Reads/(ConsistentGets+CacheGets)))"}], "lines": [{"type": "area", "legend": "Ratio", "color": "aqua", "datapointName": "Ratio", "isVirtual": true}]}, {"name": "Disk Sorts", "title": "Disk Sorts", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskSorts", "datapointName": "DiskSorts", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Disk Sorts (these are expensive.)", "color": "orange", "datapointName": "DiskSorts", "isVirtual": false}]}, {"name": "Executions", "title": "Executions", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Commits", "datapointName": "Commits", "consolidationFn": "average"}, {"name": "Executes", "datapointName": "Executes", "consolidationFn": "average"}, {"name": "RecursiveCalls", "datapointName": "RecursiveCalls", "consolidationFn": "average"}, {"name": "Rollbacks", "datapointName": "Rollbacks", "consolidationFn": "average"}, {"name": "UserCalls", "datapointName": "UserCalls", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Commits", "color": "lime", "datapointName": "Commits", "isVirtual": false}, {"type": "line", "legend": "Executes", "color": "blue", "datapointName": "Executes", "isVirtual": false}, {"type": "line", "legend": "Recursive Calls", "color": "orange", "datapointName": "RecursiveCalls", "isVirtual": false}, {"type": "line", "legend": "Rollbacks", "color": "red", "datapointName": "Rollbacks", "isVirtual": false}, {"type": "line", "legend": "User Calls", "color": "purple", "datapointName": "UserCalls", "isVirtual": false}]}, {"name": "Logical Reads", "title": "Logical Reads", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "LogicalReads", "datapointName": "LogicalReads", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Reads", "color": "blue", "datapointName": "LogicalReads", "isVirtual": false}]}, {"name": "Logons", "title": "Logons", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Current", "datapointName": "CurrentLogons", "consolidationFn": "average"}, {"name": "Rate", "datapointName": "TotalLogons", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Current", "color": "gray", "datapointName": "Current", "isVirtual": false}, {"type": "line", "legend": "Logons/sec", "color": "fuchsia", "datapointName": "Rate", "isVirtual": false}]}, {"name": "Long Table Scans", "title": "Long Table Scans", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Scans", "datapointName": "LongTableScans", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Scans", "color": "red2", "datapointName": "Scans", "isVirtual": false}]}, {"name": "Parse Calls", "title": "Parse Calls", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Hard", "datapointName": "HardParses", "consolidationFn": "average"}, {"name": "Total", "datapointName": "TotalParses", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Hard Parses", "color": "red", "datapointName": "Hard", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "gray", "datapointName": "Total", "isVirtual": false}]}, {"name": "Physical I/O", "title": "Physical I/O", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Reads", "datapointName": "PhysicalReads", "consolidationFn": "max"}, {"name": "Writes", "datapointName": "PhysicalWrites", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "Read", "color": "silver", "datapointName": "Reads", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "olive", "datapointName": "Writes", "isVirtual": false}]}, {"name": "Redo Bytes", "title": "Redo Bytes", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "Size", "datapointName": "RedoSize", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Redo Bytes", "color": "yellow", "datapointName": "Size", "isVirtual": false}]}, {"name": "Redo Log Space Requests", "title": "Redo Log Space Requests", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "RedoLogSpaceRequests", "datapointName": "RedoLogSpaceRequests", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Redo Log Space Requests", "color": "red1", "datapointName": "RedoLogSpaceRequests", "isVirtual": false}]}, {"name": "Table Scan Blocks", "title": "Table Scan Blocks", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "TableScanBlocksGotten", "datapointName": "TableScanBlocksGotten", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Blocks", "color": "gray", "datapointName": "TableScanBlocksGotten", "isVirtual": false}]}], "overviewGraphs": [{"name": "Overall Executions", "title": "Overall Executions", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "aggregated": true, "scale1024": false, "rigid": false, "datapoints": [{"name": "Commits", "datapointName": "Commits", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "Executes", "datapointName": "Executes", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "RecursiveCalls", "datapointName": "RecursiveCalls", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "Rollbacks", "datapointName": "Rollbacks", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "UserCalls", "datapointName": "UserCalls", "consolidationFn": "average", "aggregateMethod": "average"}], "lines": [{"type": "line", "legend": "Total Commits", "color": "silver", "datapointName": "Commits", "isVirtual": false}, {"type": "line", "legend": "Total Executes", "color": "red", "datapointName": "Executes", "isVirtual": false}, {"type": "line", "legend": "Total Recursive Calls", "color": "olive", "datapointName": "RecursiveCalls", "isVirtual": false}, {"type": "line", "legend": "Total Rollbacks", "color": "orange", "datapointName": "Rollbacks", "isVirtual": false}, {"type": "line", "legend": "Total User Calls", "color": "black", "datapointName": "UserCalls", "isVirtual": false}]}]}

×DataSource: Oracle_Database_TableSpaceUsage (917)

{"name": "Oracle_Database_TableSpaceUsage", "description": "Usage metrics for Oracle TableSpace.", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "database,oracle,tablespace,usage,db", "technicalNotes": "For configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle TableSpace Usage", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n */\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\n\ndef queryOutput = [:]\ndef conn = [:]\n\n// go grab all the database names\ndef displayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\ndef sqlQuery = 'SELECT TABLESPACE_NAME FROM DBA_TABLESPACE_USAGE_METRICS'\n\ndbnamesList.each { dbname ->\n def user = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n def pass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n def port = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n //attempt to make a connection.\n conn = attemptConnection(host, port, dbname, user, pass)\n\n if (conn.status == 'success')\n {\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n queryOutput[\"data\"].each { data ->\n def wildvalue = \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}||${data.TABLESPACE_NAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n def wildAlias = \"${data.TABLESPACE_NAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")} (${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")})\"\n def ILP = \"auto.databasename=${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n \n println \"${wildvalue}##${wildAlias}######${ILP}\"\n }\n }\n }\n\n // always close the connection\n if (conn.status == 'success')\n {\n conn.connection.close()\n }\n}\n\nreturn 0\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n\n */\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\n\ndef queryOutput = [:]\ndef conn = [:]\n\n// go grab all the database names\ndef displayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\ndef sqlQuery = 'SELECT TABLESPACE_NAME, TABLESPACE_SIZE, USED_SPACE, round(USED_PERCENT,1) as USED_PERCENT FROM DBA_TABLESPACE_USAGE_METRICS'\n\ndbnamesList.each { dbname ->\n def user = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n def pass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n def port = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n //attempt to make a connection.\n conn = attemptConnection(host, port, dbname, user, pass)\n\n if (conn.status == 'success')\n {\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n queryOutput[\"data\"].each { data ->\n def wildvalue = \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}||${data.TABLESPACE_NAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n\n println \"${wildvalue}.TableSpaceSize=${data.TABLESPACE_SIZE}\"\n println \"${wildvalue}.UsedSpace=${data.USED_SPACE}\"\n println \"${wildvalue}.UsedPercent=${data.USED_PERCENT}\"\n\n }\n }\n }\n\n // always close the connection\n if (conn.status == 'success')\n {\n conn.connection.close()\n }\n\n}\n\nreturn 0\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "datapoints": [{"name": "TableSpaceSize", "description": "The total number of blocks in the tablespace.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.TableSpaceSize", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UsedSpace", "description": "The number of used blocks in the tablespace.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.UsedSpace", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "usedPercent", "description": "Percentage of used space, as a function of the maximum possible tablespace size", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.UsedPercent", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "> 85 90 95", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "The host ##HOST## with Database name and Table Space ##WILDALIAS## has exceeded ##VALUE## percent usage putting the Table Space in and alert. This started at ##START##, or ##DURATION## ago.\n\nThe alert is set to start at ##LEVEL##"}], "graphs": [{"name": "Percent of Table Space Used", "title": "Percent of Table Space Used", "verticalLabel": "%", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "usedPercent", "datapointName": "usedPercent", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Percentage Used", "color": "silver", "datapointName": "usedPercent", "isVirtual": false}]}, {"name": "Usage in Storage Blocks", "title": "Usage in Storage Blocks", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "TableSpaceSize", "datapointName": "TableSpaceSize", "consolidationFn": "average"}, {"name": "UsedSpace", "datapointName": "UsedSpace", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Total", "color": "olive", "datapointName": "TableSpaceSize", "isVirtual": false}, {"type": "area", "legend": "Used", "color": "red", "datapointName": "UsedSpace", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Table Spaces by Block Usage", "title": "Top 10 Table Spaces by Block Usage", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "UsedSpace", "datapointName": "UsedSpace", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Space Used in Database Blocks", "color": "silver", "datapointName": "UsedSpace", "isVirtual": false}]}, {"name": "Top 10 Table Spaces by Percent Usage", "title": "Top 10 Table Spaces by Percent Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "usedPercent", "datapointName": "usedPercent", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE## Percent of Table Space Used", "color": "silver", "datapointName": "usedPercent", "isVirtual": false}]}]}

×DataSource: Oracle_Database_TableSpaceUsageMaxGrowth (916)

{"name": "Oracle_Database_TableSpaceUsageMaxGrowth", "description": "Displays the allocated and free bytes for a tablespace within the data files, showing the maximum size to which a datafile can grow.", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "database,oracle,tablespace", "technicalNotes": "Uses only the DBA_TABLESPACE_USAGE_METRICS table. This is how oracle chooses to present the information in its tables unaltered.\nFor additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle TableSpace Usage (Maximum TableSpace Growth)", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n */\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef wildvalue = \"\"\ndef wildAlias = \"\"\ndef ILP = \"\"\n\ndef queryOutput = [:]\ndef conn = [:]\n\n// go grab all the database names\ndef displayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\ndef sqlQuery = 'SELECT TABLESPACE_NAME, BLOCK_SIZE FROM DBA_TABLESPACES ' +\n 'Where TABLESPACE_NAME != \\'UNDOTBS1\\'' //exclude the undotbs1. It should always be almost full in an active DB.\n\ndbnamesList.each { dbname ->\n def user = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n def pass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n def port = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n //attempt to make a connection.\n conn = attemptConnection(host, port, dbname, user, pass)\n\n if (conn.status == 'success')\n {\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n\n queryOutput[\"data\"].each { data ->\n wildvalue = \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}||${data.TABLESPACE_NAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n wildAlias = \"${data.TABLESPACE_NAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")} (${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")})\"\n ILP = \"auto.blocksize=${data.BLOCK_SIZE}&auto.databasename=${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n\n println \"${wildvalue}##${wildAlias}######${ILP}\"\n }\n }\n }\n\n // always close the connection\n if (conn.status == 'success')\n {\n conn.connection.close()\n }\n}\n\nreturn 0\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n\n*/\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\n\ndef queryOutput = [:]\ndef conn = [:]\n\n// go grab all the database names\ndef displayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\ndef sqlQuery = 'SELECT TABLESPACE_NAME, TABLESPACE_SIZE, USED_SPACE, round(USED_PERCENT,2) USED_PERCENT FROM DBA_TABLESPACE_USAGE_METRICS'\n\ndbnamesList.each { dbname ->\n def user = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n def pass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n def port = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n //attempt to make a connection.\n conn = attemptConnection(host, port, dbname, user, pass)\n\n if (conn.status == 'success')\n {\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n queryOutput[\"data\"].each { data ->\n def wildvalue = \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}||${data.TABLESPACE_NAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n\n println \"${wildvalue}.TableSpaceBlocks=${data.TABLESPACE_SIZE}\"\n println \"${wildvalue}.UsedBlocks=${data.USED_SPACE}\"\n println \"${wildvalue}.UsedPercent=${data.USED_PERCENT}\"\n }\n }\n }\n\n // always close the connection\n if (conn.status == 'success')\n {\n conn.connection.close()\n }\n}\n\nreturn 0\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "datapoints": [{"name": "TableSpaceBlocks", "description": "The total number of blocks in the tablespace.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.TableSpaceBlocks", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TableSpaceSize", "description": "Maximum allocatable size in bytes of the table space based on block count", "interpretMethod": "expression", "interpretExpr": "TableSpaceBlocks * ##auto.blocksize##", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UsedBlocks", "description": "The number of used blocks in the tablespace.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.UsedBlocks", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UsedPercent", "description": "The percentage of the tablespace used.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.UsedPercent", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "> 85 90 95", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "The tablespace ##INSTANCE## on ##HOST## is at ##VALUE## usage and has been since ##START## (or ##DURATION## ago).\n\nError starts when tablespace is greater than ##LEVEL##."}, {"name": "UsedSpace", "description": "space used (bytes) in tablespace. Based on the used block count.", "interpretMethod": "expression", "interpretExpr": "UsedBlocks * ##auto.blocksize##", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Percent Used", "title": "Percent Used", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "UsedPercent", "datapointName": "UsedPercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Used", "color": "red", "datapointName": "UsedPercent", "isVirtual": false}]}, {"name": "Usage", "title": "Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "TableSpaceSize", "datapointName": "TableSpaceSize", "consolidationFn": "average"}, {"name": "UsedSpace", "datapointName": "UsedSpace", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Total", "color": "olive", "datapointName": "TableSpaceSize", "isVirtual": false}, {"type": "area", "legend": "Used", "color": "red", "datapointName": "UsedSpace", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Table Spaces by Percent Usage", "title": "Top 10 Table Spaces by Percent Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "UsedPercent", "datapointName": "UsedPercent", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "UsedPercent", "isVirtual": false}]}, {"name": "Top 10 Table Spaces by Usage", "title": "Top 10 Table Spaces by Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "UsedSpace", "datapointName": "UsedBlocks", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "UsedSpace", "isVirtual": false}]}]}

×DataSource: Oracle_Database_Troubleshooter (748)

{"name": "Oracle_Database_Troubleshooter", "description": "Shows problems with Oracle Database configuration problems. Checks table permissions to make sure all tables are available.", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "troubleshoot,database,oracle", "technicalNotes": "Collect and active discovery must run on the same time interval.\nChecks to see if the monitor user has access to the table DBA_SYS_PRIVS. Only a DBA would have access to this table. Then checks each table for select privileges. Instances will be deleted immediately when a problem is fixed.", "displayedAs": "Oracle Database Troubleshooter", "collectionInterval": "15m", "collectionMethod": "datapump", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "\n/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n\nConnection Errors List\n ORA-01017: invalid username/password; logon denied\n [IO Error: The Network Adapter could not establish the connection, IO Error: The Network Adapter could not establish the connection] -- PROBABLY a bad Port\n [IO Error: The Network Adapter could not establish the connection, IO Error: Unknown host specified ] -- bad host name\n ORA-12505, TNS:listener does not currently know of SID given in connect descriptor -- Bad Database name\n TNS-12505, TNS:listener does not currently know of SID given in connect descriptor\n ORA-28000: the account is locked\nSQL Query Errors:\n ORA-00942: table or view does not exist -- this will happen if the user doesn't have access to a table or it doesn't exist.\n */\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef wildValue = \"\"\ndef wildAlias = \"\"\ndef ILP = \"\"\n\ndef queryOutput = [:]\n\n//List of Tables with read-only access needed for the core datasources\n// add and new required tables here\ndef requiredTables = [\n 'DBA_SEGMENTS',\n 'DBA_TABLESPACE_USAGE_METRICS',\n 'DBA_TABLESPACES',\n 'V_$LIBRARYCACHE',\n 'V_$LOCK',\n 'V_$PROCESS',\n 'V_$SESSION',\n 'V_$SESSION_LONGOPS',\n 'V_$SQL',\n 'V_$SYSSTAT' ,\n 'V_$RESOURCE_LIMIT',\n 'V_$BACKUP_FILES',\n 'V_$RMAN_OUTPUT',\n 'V_$RMAN_BACKUP_JOB_DETAILS',\n 'V_$BACKUP_ASYNC_IO' ,\n 'V_$SYSMETRIC'\n]\n\ndef whereClause = \"\\'\"+ requiredTables.join(\"\\', \\'\") +\"\\'\"\n\n// go grab all the database names\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n println \"NoDatabaseNames##Server Not Configured. No database names.######auto.databasename=NoDatabaseNames&auto.oracle.showerror=1&auto.oracle.solution=Please make sure the database names are in the resource property oracle.dbnames or auto.oracle.dbnames\"\n return 0\n}\n\ndbnamesList.each { dbname ->\n def user = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n def pass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n def port = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n //attempt to make a connection.\n def conn = attemptConnection(host, port, dbname, user, pass)\n\n if (conn.status == 'success')\n {\n\n // first check if user is a DBA. if so they have access to everything.\n sqlQuery = 'select count(*) as count from dba_sys_privs'\n queryOutput = runQuery(sqlQuery, conn['connection'])\n if (queryOutput.status == \"Success\")\n {\n // Only a sysdba would have access to this table. Who made a monitor user sysdba?\n // do nothing\n }\n else\n {\n\n //check to see if this is a container database. If it is then add CONTAINER=ALL to the\n sqlQuery = 'SELECT CDB FROM V\\$DATABASE'\n queryOutput = runQuery(sqlQuery, conn['connection'])\n def CDB = ''\n if (queryOutput.status == \"Success\")\n {\n if(queryOutput.data.CDB == ['YES']){\n CDB= \"${URLEncoder.encode(\" CONTAINER=ALL\".toString())}\"\n }\n\n }\n queryOutput=[:]\n\n sqlQuery = 'SELECT distinct TABLE_NAME FROM user_tab_privs where PRIVILEGE=\\'SELECT\\' \\n' +\n 'and TABLE_NAME in ('+whereClause +')'\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n requiredTables.each{tableName->\n wildValue = dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") +\"||\" + tableName.toString().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")\n ILP = \"auto.databasename=${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")} & auto.oracle.showerror=1 & auto.oracle.solution = Enter this command into the SQLPlus console as sysdba to fix this problem: GRANT SELECT ON \"+ tableName.toString() + \" TO \" + user.toString() + CDB.toString() + ';'\n wildAlias = queryOutput.data.TABLE_NAME.contains(tableName) ? '' :tableName + \" is missing SELECT permissions for DataBase \" + dbname + \", user \" + user.trim()\n if (wildAlias != ''){\n println wildValue +\"##\"+ wildAlias +\"######\" + ILP\n }\n }\n }\n }\n }\n else\n {\n wildValue = dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")\n\n if (conn.errors.toString().contains(\"ORA-01017\"))\n {\n errorMessage = 'Check username and password in jdbc.oracle.pass and jdbc.oracle.user'\n }\n else if ( conn.errors.toString().contains('Unknown host specified')){\n errorMessage='Check hostname in properties. Make sure it is not localhost or 127.0.0.1'\n }\n else if ( conn.errors.toString().contains('-12505')){\n errorMessage = 'Check the database name'\n }\n else if ( conn.errors.toString().contains('IO Error:')){\n errorMessage = 'Check jdbc.oracle.port property'\n }\n else if ( conn.errors.toString().contains('ORA-28000')){\n errorMessage = 'Account is locked out'\n }\n else {\n // undefined error. Print it.\n errorMessage = conn.errors.toString().substring(1,50)\n }\n\n println wildValue +'##'+errorMessage+' (' +wildValue + ')######'+ 'auto.oracle.errormessage='+errorMessage +' & auto.oracle.solution = Check LM properties & auto.oracle.showerror=1 & auto.databasename='+dbname.trim().replaceAll(/[:|\\\\\\\\|\\\\s|=]+/, \"_\")\n\n }\n // always close the connection\n if (conn.status == 'success')\n {\n conn.connection.close()\n }\n}\n\nreturn 0\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "datapoints": [{"name": "inErrorState", "description": "If this is available it's an error.", "interpretMethod": "none", "useValue": "const1", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "= 1 1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The host, ##HOST## with Database name and Table Space ##INSTANCE## has a configuration error. \n\n##auto.oracle.solution## \n\n\n\nThis error started on ##START## has existed for ##DURATION##.\n\n\nThe only value for this alert is ##VALUE##.\n\n ##LEVEL##\""}], "graphs": [{"name": "Configuration Error", "title": "Configuration Error", "verticalLabel": "status code", "min": 0.0, "max": 1.0, "displayPriority": 1, "timeScale": "2hour", "scale1024": false, "rigid": false, "datapoints": [{"name": "inErrorState", "datapointName": "inErrorState", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "One if Error", "color": "red", "datapointName": "inErrorState", "isVirtual": false}]}], "overviewGraphs": [{"name": "Errors in Instance", "title": "Errors in Instance", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "2hour", "aggregated": true, "scale1024": false, "rigid": false, "datapoints": [{"name": "inErrorState", "datapointName": "inErrorState", "consolidationFn": "max", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Error count", "color": "red", "datapointName": "inErrorState", "isVirtual": false}]}]}

×DataSource: Oracle_Database_SystemMetrics (1191)

{"name": "Oracle_Database_SystemMetrics", "description": "Displays the system metric values from the V$Sysmetric table on an Oracle DB. This data is for the prior 60 seconds.", "appliesTo": "hasCategory(\"OracleDB\")", "searchKeywords": "database,oracle,multi database,statistics", "technicalNotes": "V$SYSMETRIC displays the system metric values captured for the most current time interval for both the long duration (60-second) and short duration (15-second) system metrics. Since our minimum time configuration is 1 minute we only use the 60 second metrics. Please set to collect every 1 minute. This datasource should have minimal impact on both the collector and the database.", "displayedAs": "Oracle System Metrics", "collectionInterval": "1m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef displayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\") ?: \"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames = (hostProps.get(\"auto.oracle.dbnames\") ?: \"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames = (hostProps.get(\"dbnames\") ?: \"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames = (hostProps.get(\"dbname\") ?: \"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == []) {\n println \"No Database Names available on Host \" + displayName\n return 1\n}\n\ndbnamesList.each { dbname ->\n //regex removes any invalid characters in the list\n println \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}##${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}######auto.oracle.dbname=${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n}\n\nreturn 0"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n/**\n * Some of the information here is from this site:\n * https://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n */\n\nimport groovy.sql.Sql\n\n// Set host variables.\ndef host = hostProps.get(\"system.hostname\")\n\n//check to see if this database has a specified username, password and port. If not use the jdbc password\ndef conn = []\n\n// update this field list to add more Metrics to this where clause.\n// use \"select distinct Metric_ID, Metric_Name from v$sysmetric\" to list out all potential metrics in oracle.\n\ndef fieldList = [2000: 'bufferCacheHitRatio',\n 2050: 'cursorCachehitRatio',\n 2112: 'libraryCachehitRatio',\n 2114: 'sharedPoolFreePerc',\n 2004: 'physicalReadsPerSec',\n 2006: 'physicalWritesPerSec',\n 2059: 'enqueueTimeoutsPerSec',\n 2094: 'gccrBlockReceivedPerSec',\n 2101: 'globalCacheBlocksCorrupt',\n 2102: 'globalCacheBlocksLost',\n 2018: 'logonsPerSec',\n 2147: 'averageActiveSessions',\n 2036: 'longTableScansPerSec',\n 2106: 'sqlServiceResponseTime',\n 2024: 'userRollbacksPerSec',\n 2133: 'ttlSortsPerUserCall',\n 2053: 'rowsPerSort',\n 2051: 'diskSortsPerSec',\n 2001: 'memorySortsRatio',\n 2107: 'databaseWaitTimeRatio',\n 2119: 'sessionLimitPerc',\n 2143: 'sessionCount',\n 2157: 'tempSpaceUsed'\n]\n\ndef whereClause = fieldList.keySet().join(\", \")\n\n// create the query to get all the stats\n// v$sysmetric table description https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/V-SYSMETRIC.html#GUID-623748C3-F765-4149-8378-F5CDAD59909A\n// the INTSIZE_CSEC > 5000 restricts the output to the fields where the collection interval is 60 seconds\nsqlQuery = \"SELECT metric_ID as METRICID\" +\n \" , value\" +\n \" from v\\$sysmetric \" +\n \"where INTSIZE_CSEC > 5000 and metric_id in (\" + whereClause + \")\"\ndef queryOutput = [:]\n\n\n// get all of the database names for the instance\ndisplayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\") ?: \"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames = (hostProps.get(\"auto.oracle.dbnames\") ?: \"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames = (hostProps.get(\"dbnames\") ?: \"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames = (hostProps.get(\"dbname\") ?: \"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == []) {\n println \"No Database Names available on Host \" + displayName + \" Please make sure the database names are in the property oracle.dbnames\"\n return 1\n}\n\ndbnamesList.each { dbname ->\n\n user = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n pass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n port = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n // attempt to make a connection.\n conn = attemptConnection(host, port, dbname, user, pass)\n if (conn.status == 'success') {\n queryOutput = runQuery(sqlQuery, conn['connection'])\n if (queryOutput.status == \"Success\") {\n wildValue = dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")\n queryOutput[\"data\"].each { data ->\n if (fieldList.containsKey(data[\"METRICID\"].toInteger())) {\n println \"${wildValue}.${fieldList[data[\"METRICID\"].toInteger()].toString()}=${data[\"VALUE\"].toString()}\"\n }\n }\n } else {\n println dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\") + '.error=' + queryOutput.error\n return 1\n }\n }\n // always close the connection\n if (conn['status'] == 'Success') {\n conn[0].close()\n }\n println \"${dbname}.instanceName=${dbname}\"\n}\n\nreturn 0\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost, inPort, inName, inUser, inPass) {\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e) {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n if (connComplete == false) {\n try {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e) {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n } else {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n return returnArray\n}\n\n//End of attemptConnection\n/*******************************\n * Attempt to execute SQL command.\n * Returns an array.\n * the first element is the query data\n * second element is success or fail\n * third element is the error message\n */\ndef runQuery(String sqlQuery, conn) {\n returnArray = [:]\n // query the Oracle DB.\n try {\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e) {\n returnArray['error'] = e.message\n returnArray['status'] = 'Failed'\n }\n\n return returnArray\n}\n/***********************************************************\n * Attempt to execute SQL command that doesn't return any data.\n * Returns an array.\n * the first element is the query data\n * second element is success or fail\n * third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn) {\n\n returnArray = [:]\n // query the Oracle DB.\n try {\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error'] = ''\n }\n catch (Exception e) {\n returnArray['error'] = e.message\n returnArray['status'] = 'Failed'\n }\n\n return returnArray\n}"}, "datapoints": [{"name": "averageActiveSessions", "description": "The average number active sessions over the last 60 second interval", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.averageActiveSessions", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "bufferCacheHitRatio", "description": "Buffer Cache hit ratio. \n\nUnits: % (LogRead - PhyRead)/LogRead", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.bufferCacheHitRatio", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "< 75 50 40", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "Oracle database on ##HOST## is experiencing a low number buffer cache hits. , at ##VALUE## % , placing the host into ##LEVEL## state.\n\nLow buffer cache hits are disk intensive. Please increase memory buffers. \n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "cursorCachehitRatio", "description": "Cursor Cache hit ratio. \n\nUnits: % CursorCacheHit/SoftParse", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cursorCachehitRatio", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "databaseWaitTimeRatio", "description": "% Database wait time. WaitTime/DB_Time where DB_Time is approx. 60 seconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.databaseWaitTimeRatio", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "diskSortsPerSec", "description": "Disk Sorts Per Second for the last 60 seconds. These are database sorts that use disk instead of memory. Should usually be 0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.diskSortsPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "enqueueTimeoutsPerSec", "description": "This metric represents the total number of table and row locks (acquired and converted) per second that time out before they could complete.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.enqueueTimeoutsPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "gccrBlockReceivedPerSec", "description": "Global Cache Current blocks received\nUnits: Blocks Per Second", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.gccrBlockReceivedPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "globalCacheBlocksCorrupt", "description": "This metric represents the number of blocks that encountered a corruption or checksum failure during interconnect over the user-defined observation period.\n\nUnits:Blocks", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.globalCacheBlocksCorrupt", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0 0 3", "noData": "Do not trigger an alert", "triggerInterval": 2, "clearInterval": 0, "alertBody": "##HOST## database ##INSTANCE## has ##VALUE## Global Cache Block Corrupt, placing the host into ##LEVEL## state. \n\nIt has been this way since ##START##, -- or for ##DURATION##.\n\nGlobal cache block corruption is usually from a transmission error that can be caused by network problems or adapter hardware issues."}, {"name": "globalCacheBlocksLost", "description": "Global Cache Blocks lost. Can be related to networking problems.\n\nunits:Blocks", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.globalCacheBlocksLost", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 5 10 25", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "##HOST## database ##INSTANCE## has ##VALUE## Global Cache Blocks Lost, placing the host into ##LEVEL## state. \n\nIt has been this way since ##START##, -- or for ##DURATION##.\n\nGlobal cache block corruption is usually from a transmission error that can be caused by network problems or adapter hardware issues."}, {"name": "libraryCachehitRatio", "description": "This metric represents the library cache efficiency, as measured by the percentage of times the fully parsed or compiled representation of PL/SQL blocks and SQL statements are already in memory.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.libraryCachehitRatio", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "logonsPerSec", "description": "Logons Per Second", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.logonsPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "longTableScansPerSec", "description": "Long table scans in Scans Per Second", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.longTableScansPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "memorySortsRatio", "description": "% MemSort/(MemSort + DiskSort)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.memorySortsRatio", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "physicalReadsPerSec", "description": "Physical Reads Per Second\n\nunits: Reads Per Second", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.physicalReadsPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "physicalWritesPerSec", "description": "Physical Writes per second\n\nUnits: Writes Per Second", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.physicalWritesPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "rowsPerSort", "description": "The Rows Per Sort Oracle metric is the average number of rows per sort for all types of sorts performed. Units:Rows Per Sort", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.rowsPerSort", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "sessionCount", "description": "Number of Sessions", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sessionCount", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "sessionLimitPerc", "description": "Sessions limit in % Sessions/Limit", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sessionLimitPerc", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "sharedPoolFreePerc", "description": "Shared Pool Percent Free \n\nunits: % Free/Total", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sharedPoolFreePerc", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "sqlServiceResponseTime", "description": "SQL Service Response Time in CentiSeconds Per Call", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sqlServiceResponseTime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "tempSpaceUsed", "description": "temp space used in bytes", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.tempSpaceUsed", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "ttlSortsPerUserCall", "description": "Total Sorts Per Call", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ttlSortsPerUserCall", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}, {"name": "userRollbacksPerSec", "description": "User Rollbacks in Rollbacks Per Second", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.userRollbacksPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}], "graphs": [{"name": "Average Active Sessions", "title": "Average Active Sessions", "verticalLabel": "count", "min": 0.0, "displayPriority": 120, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "averageActiveSessions", "datapointName": "averageActiveSessions", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Average Active Sessions", "color": "silver", "datapointName": "averageActiveSessions", "isVirtual": false}]}, {"name": "Cache Statistics", "title": "Cache Statistics", "verticalLabel": "%", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "bufferCacheHitRatio", "datapointName": "bufferCacheHitRatio", "consolidationFn": "average"}, {"name": "cursorCachehitRatio", "datapointName": "cursorCachehitRatio", "consolidationFn": "average"}, {"name": "libraryCachehitRatio", "datapointName": "libraryCachehitRatio", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Buffer Cache hit ratio, % (LogRead - PhyRead)/LogRead", "color": "silver", "datapointName": "bufferCacheHitRatio", "isVirtual": false}, {"type": "line", "legend": "Cursor Cache Hit Ratio, % CursorCacheHit/SoftParse ", "color": "green", "datapointName": "cursorCachehitRatio", "isVirtual": false}, {"type": "line", "legend": "Library Cache Hit Ratio, % Hits/Pins", "color": "red2", "datapointName": "libraryCachehitRatio", "isVirtual": false}]}, {"name": "Database Wait Time Ratio", "title": "Database Wait Time Ratio", "verticalLabel": "%", "min": 0.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "databaseWaitTimeRatio", "datapointName": "databaseWaitTimeRatio", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Database Wait Time Ratio", "color": "yellow", "datapointName": "databaseWaitTimeRatio", "isVirtual": false}]}, {"name": "Disk Sorts", "title": "Disk Sorts", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 80, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "diskSortsPerSec", "datapointName": "diskSortsPerSec", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Disk Sorts Per Second", "color": "black", "datapointName": "diskSortsPerSec", "isVirtual": false}]}, {"name": "Enqueue Timeouts Per Second", "title": "Enqueue Timeouts Per Second", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 90, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "enqueueTimeoutsPerSec", "datapointName": "enqueueTimeoutsPerSec", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Enqueue Timeouts Per Second", "color": "orange2", "datapointName": "enqueueTimeoutsPerSec", "isVirtual": false}]}, {"name": "Global Cache Current Statistics", "title": "Global Cache Current Statistics", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 40, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "gccrBlockReceivedPerSec", "datapointName": "gccrBlockReceivedPerSec", "consolidationFn": "average"}, {"name": "globalCacheBlocksCorrupt", "datapointName": "globalCacheBlocksCorrupt", "consolidationFn": "average"}, {"name": "globalCacheBlocksLost", "datapointName": "globalCacheBlocksLost", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "gccrBlocksCorruptPerSec", "expr": "globalCacheBlocksCorrupt/60"}, {"name": "globalCacheBlocksLostPerSec", "expr": "globalCacheBlocksLost/60"}], "lines": [{"type": "line", "legend": "Global Cache Current blocks received per second", "color": "teal", "datapointName": "gccrBlockReceivedPerSec", "isVirtual": false}, {"type": "line", "legend": "Global Cache Blocks currupted per second", "color": "red", "datapointName": "gccrBlocksCorruptPerSec", "isVirtual": true}, {"type": "line", "legend": "Global Cache blocks lost per second", "color": "yellow", "datapointName": "globalCacheBlocksLostPerSec", "isVirtual": true}]}, {"name": "Logons Per Second", "title": "Logons Per Second", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 25, "timeScale": "8hour", "scale1024": false, "rigid": false, "datapoints": [{"name": "logonsPerSec", "datapointName": "logonsPerSec", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Logons Per Second", "color": "silver", "datapointName": "logonsPerSec", "isVirtual": false}]}, {"name": "Long Table Scans", "title": "Long Table Scans", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "longTableScansPerSec", "datapointName": "longTableScansPerSec", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Long Table Scans", "color": "purple", "datapointName": "longTableScansPerSec", "isVirtual": false}]}, {"name": "Memory Sort Ratio", "title": "Memory Sort Ratio", "verticalLabel": "%", "min": 0.0, "displayPriority": 100, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "memorySortsRatio", "datapointName": "memorySortsRatio", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Memory Sort Ratio", "color": "olive", "datapointName": "memorySortsRatio", "isVirtual": false}]}, {"name": "Physical Reads and Writes", "title": "Physical Reads and Writes", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 65, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "physicalReadsPerSec", "datapointName": "physicalReadsPerSec", "consolidationFn": "average"}, {"name": "physicalWritesPerSec", "datapointName": "physicalWritesPerSec", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Physical Reads Per Second", "color": "aqua", "datapointName": "physicalReadsPerSec", "isVirtual": false}, {"type": "line", "legend": "Physical Writes Per Second", "color": "lime", "datapointName": "physicalWritesPerSec", "isVirtual": false}]}, {"name": "Rows Per Sort", "title": "Rows Per Sort", "verticalLabel": "count", "min": 0.0, "displayPriority": 80, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "rowsPerSort", "datapointName": "rowsPerSort", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Rows per sort", "color": "blue", "datapointName": "rowsPerSort", "isVirtual": false}]}, {"name": "SQL Service Response Time", "title": "SQL Service Response Time", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 60, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "sqlServiceResponseTime", "datapointName": "sqlServiceResponseTime", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "sqlServerResponseTime_ms", "expr": "sqlServiceResponseTime*.01"}], "lines": [{"type": "line", "legend": "SQL Server Response Time", "color": "olive", "datapointName": "sqlServerResponseTime_ms", "isVirtual": true}]}, {"name": "Sessions", "title": "Sessions", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "sessionsCount", "datapointName": "sessionCount", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "sessionsCount", "color": "teal", "datapointName": "sessionsCount", "isVirtual": false}]}, {"name": "Sessions Limit", "title": "Sessions Limit", "verticalLabel": "%", "min": 0.0, "displayPriority": 110, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "sessionLimitPerc", "datapointName": "sessionLimitPerc", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Sessions Limit Percent", "color": "silver", "datapointName": "sessionLimitPerc", "isVirtual": false}]}, {"name": "Shared Pool Percent Free", "title": "Shared Pool Percent Free", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 140, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "sharedPoolFreePerc", "datapointName": "sharedPoolFreePerc", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Shared Pool Percent Free, % Free/Total", "color": "green", "datapointName": "sharedPoolFreePerc", "isVirtual": false}]}, {"name": "Temp Space Used", "title": "Temp Space Used", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 115, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "tempSpaceUsed", "datapointName": "tempSpaceUsed", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Temp Space Used in bytes", "color": "black", "datapointName": "tempSpaceUsed", "isVirtual": false}]}, {"name": "Total Sorts Per Call", "title": "Total Sorts Per Call", "verticalLabel": "count", "displayPriority": 70, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ttlSortsPerUserCall", "datapointName": "ttlSortsPerUserCall", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Total Sorts Per Call", "color": "orange", "datapointName": "ttlSortsPerUserCall", "isVirtual": false}]}, {"name": "User Rollbacks", "title": "User Rollbacks", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 160, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "userRollbacksPerSec", "datapointName": "userRollbacksPerSec", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "User Rollbacks per Second", "color": "teal", "datapointName": "userRollbacksPerSec", "isVirtual": false}]}], "overviewGraphs": [{"name": "Global Cache Blocks", "title": "Global Cache Blocks", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "globalCacheBlocksCorrupt", "datapointName": "globalCacheBlocksCorrupt", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "globalCacheBlocksLost", "datapointName": "globalCacheBlocksLost", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Global Cache Blocks Corrupted", "color": "silver", "datapointName": "globalCacheBlocksCorrupt", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Global Cache Blocks Lost", "color": "silver", "datapointName": "globalCacheBlocksLost", "isVirtual": false}]}, {"name": "Physical Reads and Writes", "title": "Physical Reads and Writes", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "physicalReadsPerSec", "datapointName": "physicalReadsPerSec", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "physicalWritesPerSec", "datapointName": "physicalWritesPerSec", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Physical Reads per Second", "color": "silver", "datapointName": "physicalReadsPerSec", "isVirtual": false}, {"type": "line", "legend": "##INSTANCE## Physical Writes per Second", "color": "silver", "datapointName": "physicalWritesPerSec", "isVirtual": false}]}, {"name": "Sessions", "title": "Sessions", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "sessionCount", "datapointName": "sessionCount", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## Session Count", "color": "silver", "datapointName": "sessionCount", "isVirtual": false}]}]}

×DataSource: Oracle_Database_LongOperations (927)

{"name": "Oracle_Database_LongOperations", "description": "Information about the latest operations lasting over 6 seconds.", "appliesTo": "/* Automatically set by PropertySource */\nhasCategory(\"OracleDB\")", "searchKeywords": "database,oracle", "technicalNotes": "For additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle Latest Long Operations", "collectionInterval": "15m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n */\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef wildvalue = \"\"\ndef wildAlias = \"\"\ndef ILP = \"\"\n\ndef queryOutput = [:]\ndef conn = [:]\n\n// go grab all the database names\n\n\tdisplayName = hostProps.get(\"system.displayname\")\n\tdef dbnamesList = []\n\n// check manually set dbnames\n\tdbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\n\tdbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\n\tdbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\n\tdbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n\n//check old dbnames field for backward compatability\n\tdbnames= (hostProps.get(\"dbnames\") ?:\"\")\n\tdbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\n\tdbnames= (hostProps.get(\"dbname\") ?:\"\")\n\tdbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\n\tdbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\n\tif (dbnamesList == [])\n\t{\n\t\treturn 0\n\t}\n\n\tsqlQuery = 'SELECT distinct OPNAME FROM V$SESSION_LONGOPS'\n\n\tdbnamesList.each { dbname ->\n\t\tuser = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n\t\tpass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n\t\tport = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n\n\t\t//attempt to make a connection.\n\t\tconn = attemptConnection(host, port, dbname, user, pass)\n\n\t\tif (conn.status == 'success')\n\t\t{\n\t\t\tqueryOutput = runQuery(sqlQuery, conn['connection'])\n\n\t\t\tif (queryOutput.status == \"Success\")\n\t\t\t{\n\n\t\t\t\tqueryOutput[\"data\"].each { data ->\n\t\t\t\t\twildvalue = \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}||${data.OPNAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n\t\t\t\t\twildAlias = \"${data.OPNAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")} (${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")})\"\n\t\t\t\t\tILP = \"auto.databasename=${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n\n\t\t\t\t\tprintln \"${wildvalue}##${wildAlias}######${ILP}\"\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// always close the connection\n\t\tif (conn.status == 'success')\n\t\t{\n\t\t\tconn.connection.close()\n\t\t}\n\t}\n\n\treturn 0\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n\tdef returnArray = [:]\n\tdef errors = []\n\tdef connComplete\n\tdef db_connection\n\n\ttry\n\t{\n\t\tdef url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n\t\t// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n\t\t// Create a connection to the database.\n\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\tconnComplete = true\n\n\t}\n\tcatch (Exception e)\n\t{\n\t\t// Print out the exception and exit with 1.\n\t\terrors[0] = e.message\n\t\tconnComplete = false\n\t}\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n\tif (connComplete == false)\n\t{\n\t\ttry\n\t\t{\n\t\t\turl = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n\t\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\t\tconnComplete = true\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t// Print out the exception and exit with 1.\n\t\t\terrors[1] = e.message\n\t\t\tconnComplete = false\n\t\t}\n\t}\n\n\t// populate the connection and any messages for the return array\n\tif (connComplete == true) {\n\n\t\treturnArray['connection'] = db_connection\n\t\treturnArray['status'] = 'success'\n\t}\n\telse\n\t{\n\t\treturnArray['status'] = 'failed'\n\t\treturnArray['errors'] = errors\n\t}\n\n\treturn returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\n\t\treturnArray['data'] = conn.rows(sqlQuery)\n\t\treturnArray['status'] = 'Success'\n\t\treturnArray['error'] = ''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\t\treturnArray['data'] = conn.execute(sqlQuery)\n\t\treturnArray['status'] = \"Success\"\n\t\treturnArray['error']=''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n */\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef user =\"\"\ndef pass =\"\"\ndef port = \"\"\ndef wildvalue = \"\"\ndef wildAlias = \"\"\n\ndef queryOutput = [:]\ndef conn = [:]\n\n// go grab all the database names\n\ndisplayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\n\nif (dbnamesList == [])\n{\nreturn 0 \n}\n\nsqlQuery = ' SELECT lops.START_TIME\\n' +\n\t\t\t' , lops.OPNAME\\n' +\n\t\t\t' , lops.SOFAR\\n' +\n\t\t\t' , lops.TOTALWORK\\n' +\n\t\t\t' , lops.SOFAR/lops.TOTALWORK * 100 as PercentComplete\\n' +\n\t\t\t' , lops.ELAPSED_SECONDS \\n' +\n\t\t\t' , (select CURRENT_DATE from dual) - lops.START_TIME as ElapsedTime\\n' +\n\t\t\t' FROM V$SESSION_LONGOPS lops\\n' +\n\t\t\t' inner join \\n' +\n\t\t\t' (SELECT MAX(START_TIME) as START_TIME, OPNAME from V$SESSION_LONGOPS group by opname) st \\n' +\n\t\t\t' on st.START_TIME = lops.START_TIME\\n' +\n\t\t\t' and st.OPNAME = lops.OPNAME\\n' +\n\t\t\t' ORDER BY START_TIME DESC'\n\ndbnamesList.each { dbname ->\n\tuser = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n\tpass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n\tport = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n\t//attempt to make a connection.\n\tconn = attemptConnection(host, port, dbname, user, pass)\n\n\tif (conn.status == 'success')\n\t{\n\t\tqueryOutput = runQuery(sqlQuery, conn['connection'])\n\n\t\tif (queryOutput.status == \"Success\")\n\t\t{\n\n\t\t\tqueryOutput[\"data\"].each { data ->\n\t\t\t\twildvalue = \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}||${data.OPNAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n\t\t\t\twildAlias = \"${data.OPNAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")} (${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")})\"\n\n\t\t\t\tprintln \"${wildvalue}.PercentComplete=${data.PercentComplete}\"\n\t\t\t\tprintln \"${wildvalue}.ElapsedSeconds=${data.ELAPSED_SECONDS}\"\n\t\t\t\tprintln \"${wildvalue}.StartTime=${data.START_TIME.getTime()}\"\n\t\t\t\tprintln \"${wildvalue}.AgeInMinutes=${data.ElapsedTime * 1440 }\"\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// always close the connection\n\tif (conn.status == 'success')\n\t{\n\t\tconn.connection.close()\n\t}\n}\n\nreturn 0\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n\tdef returnArray = [:]\n\tdef errors = []\n\tdef connComplete\n\tdef db_connection\n\n\ttry\n\t{\n\t\tdef url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n\t\t// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n\t\t// Create a connection to the database.\n\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\tconnComplete = true\n\n\t}\n\tcatch (Exception e)\n\t{\n\t\t// Print out the exception and exit with 1.\n\t\terrors[0] = e.message\n\t\tconnComplete = false\n\t}\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n\tif (connComplete == false)\n\t{\n\t\ttry\n\t\t{\n\t\t\turl = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n\t\t\tdb_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n\t\t\tconnComplete = true\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t// Print out the exception and exit with 1.\n\t\t\terrors[1] = e.message\n\t\t\tconnComplete = false\n\t\t}\n\t}\n\n\t// populate the connection and any messages for the return array\n\tif (connComplete == true) {\n\n\t\treturnArray['connection'] = db_connection\n\t\treturnArray['status'] = 'success'\n\t}\n\telse\n\t{\n\t\treturnArray['status'] = 'failed'\n\t\treturnArray['errors'] = errors\n\t}\n\n\treturn returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\n\t\treturnArray['data'] = conn.rows(sqlQuery)\n\t\treturnArray['status'] = 'Success'\n\t\treturnArray['error'] = ''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n\treturnArray = [:]\n\t// query the Oracle DB.\n\ttry{\n\t\treturnArray['data'] = conn.execute(sqlQuery)\n\t\treturnArray['status'] = \"Success\"\n\t\treturnArray['error']=''\n\t}\n\tcatch (Exception e)\n\t{\n\t\treturnArray['error'] = e.message\n\t\treturnArray['status'] ='Failed'\n\t}\n\n\treturn returnArray\n}"}, "datapoints": [{"name": "AgeInMinutes", "description": "The number of minutes since the operation last started.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.AgeInMinutes", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ChangeFinder", "description": "Returns a non 0 value when the latest operation changes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ElapsedSeconds", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ElapsedSeconds", "description": "The number of seconds the operation took.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ElapsedSeconds", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PercentComplete", "description": "The percentage of the work done.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.PercentComplete", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Percent Complete", "title": "Percent Complete", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ChangeFinder", "datapointName": "ChangeFinder", "consolidationFn": "average"}, {"name": "PercentComplete", "datapointName": "PercentComplete", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "ChangeMarker", "expr": "if(gt(ChangeFinder,0), 100, 0)"}], "lines": [{"type": "line", "legend": "New Operation Marker", "color": "black", "datapointName": "ChangeMarker", "isVirtual": true}, {"type": "area", "legend": "Work Done", "color": "olive", "datapointName": "PercentComplete", "isVirtual": false}]}, {"name": "Time Taken", "title": "Time Taken", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ElapsedSeconds", "datapointName": "ElapsedSeconds", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Duration", "color": "yellow", "datapointName": "ElapsedSeconds", "isVirtual": false}]}], "overviewGraphs": [{"name": "Longest Operations", "title": "Longest Operations", "verticalLabel": "hours", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "AgeInMinutes", "datapointName": "AgeInMinutes", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "AgeInMinutes", "isVirtual": false}]}]}

×DataSource: Microsoft_ActiveDirectory_Computers (2345)

{"name": "Microsoft_ActiveDirectory_Computers", "description": "Active Directory Domain Computer membership information.", "appliesTo": "hasCategory(\"MicrosoftDomainController\") && hasCategory(\"InfrastructureMaster\")", "group": "Active Directory Configs", "searchKeywords": "ad,active directory,configuration,microsoft", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-adcomputer?view=win10-ps", "displayedAs": "Computers", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n#\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = \"##SYSTEM.HOSTNAME##\".ToLower()\n$winRM = '##AUTO.WINRM##'.ToLower()\n\n## Debug flag\n$DEBUG = $false\n\n\n#$winRM will default to enabled since the property source that sets it isn't universal.\nif ($winRM -EQ '##auto.winrm##')\n{\n $winRM = 'enabled'\n}\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\")\n{\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName.ToLower()\n}\nif ($DEBUG) {\"--DEBUG-- Hostname: $hostname\"}\nif ($DEBUG) {\"--DEBUG-- PS Version: $( $PSVersionTable.PSVersion )\"}\nif ($DEBUG) {\"--DEBUG-- CollectorName $collectorName \"}\nif ($DEBUG) {\"--DEBUG-- winRM $winRM \"}\n\n## check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($HOSTNAME -like $COLLECTORNAME)\n{\n if ($DEBUG) { \"--DEBUG-- Hostname is equal Collector name\"}\n $session = New-PSSession\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($WMI_USER) -and [string]::IsNullOrWhiteSpace($WMI_PASS)) -or (($WMI_USER -like '*WMI.USER*') -and ($WMI_PASS -like '*WMI.PASS*') -and $winRM -eq 'enabled' ))\n{\n # no WMI password available. Use service name user and password\n if ($DEBUG) {\"--DEBUG-- Collector user being used.\"}\n $session = New-PSSession -ComputerName $hostname\n}\nelseif ($winRM -eq \"enabled\")\n{\n\n if ($DEBUG) { \"--DEBUG-- Remote Creds: Converting user/pass to credential string\"}\n # Use remote powershell with wmi.user and wmi.pass. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $WMI_PASS -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $WMI_USER, $remote_pass;\n $session = New-PSSession -Credential $remote_credential -ComputerName $hostname\n}\nelse\n{\n \"WinRM disabled and not a local collector\"\n exit 1\n}\n\n$scriptBlock = {\n\n Get-ADComputer -Filter * | sort-object -property Name, DNSHostName, Enabled | Select-Object Name, DNSHostName, Enabled | Format-Table -Autosize | Out-String -Width 256\n}\n\n$returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n\n#try it again. Sometimes fails the first time\nif (($null -eq $returnData) -or ($returnData -eq \"\"))\n{\n $returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n}\n$returnData\n \n\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\nif ($DEBUG) { \"--DEBUG-- Successful output\"}\nEXIT 0"}, "configChecks": [{"name": "anyChange", "description": "A change was detected in the configuration or membership of Active Directory Computers.", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}, {"name": "cantRetrieve", "description": "The configuration of Active Directory Computers could not be retrieved.", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Microsoft_ActiveDirectory_DomainController (2332)

{"name": "Microsoft_ActiveDirectory_DomainController", "description": "Active Directory Domain Controller configuration information.", "appliesTo": "hasCategory(\"MicrosoftDomainController\") && hasCategory(\"InfrastructureMaster\")", "group": "Active Directory Configs", "searchKeywords": "ad,active directory,configuration,microsoft", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-addomaincontroller?view=win10-ps", "displayedAs": "Domain Controller", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n#\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = \"##SYSTEM.HOSTNAME##\".ToLower()\n$winRM = '##AUTO.WINRM##'.ToLower()\n\n## Debug flag\n$DEBUG = $false\n\n\n#$winRM will default to enabled since the property source that sets it isn't universal.\nif ($winRM -EQ '##auto.winrm##')\n{\n $winRM = 'enabled'\n}\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\")\n{\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName.ToLower()\n}\nif ($DEBUG) {\"--DEBUG-- Hostname: $hostname\"}\nif ($DEBUG) {\"--DEBUG-- PS Version: $( $PSVersionTable.PSVersion )\"}\nif ($DEBUG) {\"--DEBUG-- CollectorName $collectorName \"}\nif ($DEBUG) {\"--DEBUG-- winRM $winRM \"}\n\n## check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($HOSTNAME -like $COLLECTORNAME)\n{\n if ($DEBUG) { \"--DEBUG-- Hostname is equal Collector name\"}\n $session = New-PSSession\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($WMI_USER) -and [string]::IsNullOrWhiteSpace($WMI_PASS)) -or (($WMI_USER -like '*WMI.USER*') -and ($WMI_PASS -like '*WMI.PASS*') -and $winRM -eq 'enabled' ))\n{\n # no WMI password available. Use service name user and password\n if ($DEBUG) {\"--DEBUG-- Collector user being used.\"}\n $session = New-PSSession -ComputerName $hostname\n}\nelseif ($winRM -eq \"enabled\")\n{\n\n if ($DEBUG) { \"--DEBUG-- Remote Creds: Converting user/pass to credential string\"}\n # Use remote powershell with wmi.user and wmi.pass. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $WMI_PASS -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $WMI_USER, $remote_pass;\n $session = New-PSSession -Credential $remote_credential -ComputerName $hostname\n}\nelse\n{\n \"WinRM disabled and not a local collector\"\n exit 1\n}\n\n#simple command to make sure remote session is alive\n$sessionCheck = Invoke-Command -Session $session -ScriptBlock {$env:computername} \n\n$scriptBlock = {Get-ADDomainController | Select-Object * -ExcludeProperty RunspaceId, PropertyCount | Format-List | Out-String -Width 256}\n$returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n\n#try it again. Sometimes fails the first time\nif (($null -eq $returnData) -or ($returnData -eq \"\"))\n{\n $returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n}\n$returnData\n \nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\nif ($DEBUG) { \"--DEBUG-- Successful output\" }\nEXIT 0"}, "configChecks": [{"name": "anyChange", "description": "A change was detected in the configuration of an Active Directory Domain Controller.", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}, {"name": "cantRetrieve", "description": "The configuration of an Active Directory Domain Controller could not be retrieved.", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Microsoft_ActiveDirectory_Domains (2331)

{"name": "Microsoft_ActiveDirectory_Domains", "description": "Active Directory Domain information.", "appliesTo": "hasCategory(\"MicrosoftDomainController\") && hasCategory(\"InfrastructureMaster\")", "group": "Active Directory Configs", "searchKeywords": "ad,active directory,configuration,microsoft", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-addomain?view=win10-ps", "displayedAs": "Domains", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n#\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = \"##SYSTEM.HOSTNAME##\".ToLower()\n$winRM = '##AUTO.WINRM##'.ToLower()\n\n## Debug flag\n$DEBUG = $false\n\n\n#$winRM will default to enabled since the property source that sets it isn't universal.\nif ($winRM -EQ '##auto.winrm##')\n{\n $winRM = 'enabled'\n}\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\")\n{\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName.ToLower()\n}\nif ($DEBUG) {\"--DEBUG-- Hostname: $hostname\"}\nif ($DEBUG) {\"--DEBUG-- PS Version: $( $PSVersionTable.PSVersion )\"}\nif ($DEBUG) {\"--DEBUG-- CollectorName $collectorName \"}\nif ($DEBUG) {\"--DEBUG-- winRM $winRM \"}\n\n## check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($HOSTNAME -like $COLLECTORNAME)\n{\n if ($DEBUG) { \"--DEBUG-- Hostname is equal Collector name\"}\n $session = New-PSSession\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($WMI_USER) -and [string]::IsNullOrWhiteSpace($WMI_PASS)) -or (($WMI_USER -like '*WMI.USER*') -and ($WMI_PASS -like '*WMI.PASS*') -and $winRM -eq 'enabled' ))\n{\n # no WMI password available. Use service name user and password\n if ($DEBUG) {\"--DEBUG-- Collector user being used.\"}\n $session = New-PSSession -ComputerName $hostname\n}\nelseif ($winRM -eq \"enabled\")\n{\n\n if ($DEBUG) { \"--DEBUG-- Remote Creds: Converting user/pass to credential string\"}\n # Use remote powershell with wmi.user and wmi.pass. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $WMI_PASS -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $WMI_USER, $remote_pass;\n $session = New-PSSession -Credential $remote_credential -ComputerName $hostname\n}\nelse\n{\n \"WinRM disabled and not a local collector\"\n exit 1\n}\n\n#simple command to make sure remote session is alive\n$sessionCheck = Invoke-Command -Session $session -ScriptBlock {$env:computername} \n$scriptBlock = {Get-ADDomain | Select-Object * -ExcludeProperty RunspaceId, PropertyCount | Format-List | Out-String -Width 256 }\n\n$returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n\n#try it again. Sometimes fails the first time\nif (($null -eq $returnData) -or ($returnData -eq \"\"))\n{\n $returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n}\n$returnData\n \n \nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\nif ($DEBUG) { \"--DEBUG-- Successful output\" }\nEXIT 0"}, "configChecks": [{"name": "anyChange", "description": "A change was detected in the configuration or properties of the Active Directory Domain.", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}, {"name": "cantRetrieve", "description": "The configuration or properties of the Active Directory Domain could not be retrieved.", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Microsoft_ActiveDirectory_FSMORoles (2337)

{"name": "Microsoft_ActiveDirectory_FSMORoles", "description": "Lists FSMO roles holders in an Active Directory Domain.", "appliesTo": "hasCategory(\"MicrosoftDomainController\") && hasCategory(\"InfrastructureMaster\")", "group": "Active Directory Configs", "searchKeywords": "ad,active directory,configuration,microsoft", "technicalNotes": "Forest: https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-adforest?view=win10-ps\n\nDomain: https://docs.microsoft.com/en-us/powershell/module/addsadministration/Get-ADDomain?view=win10-ps", "displayedAs": "FSMO Roles", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n#\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = \"##SYSTEM.HOSTNAME##\".ToLower()\n$winRM = '##AUTO.WINRM##'.ToLower()\n\n## Debug flag\n$DEBUG = $false\n\n\n#$winRM will default to enabled since the property source that sets it isn't universal.\nif ($winRM -EQ '##auto.winrm##')\n {\n $winRM = 'enabled'\n }\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\")\n{\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName.ToLower()\n}\nif ($DEBUG) {\"--DEBUG-- Hostname: $hostname\"}\nif ($DEBUG) {\"--DEBUG-- PS Version: $( $PSVersionTable.PSVersion )\"}\nif ($DEBUG) {\"--DEBUG-- CollectorName $collectorName \"}\nif ($DEBUG) {\"--DEBUG-- winRM $winRM \"}\n\n## check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($HOSTNAME -like $COLLECTORNAME)\n{\n if ($DEBUG) { \"--DEBUG-- Hostname is equal Collector name\"}\n $session = New-PSSession\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($WMI_USER) -and [string]::IsNullOrWhiteSpace($WMI_PASS)) -or (($WMI_USER -like '*WMI.USER*') -and ($WMI_PASS -like '*WMI.PASS*') -and $winRM -eq 'enabled' ))\n{\n # no WMI password available. Use service name user and password\n if ($DEBUG) {\"--DEBUG-- Collector user being used.\"}\n $session = New-PSSession -ComputerName $hostname\n}\nelseif ($winRM -eq \"enabled\")\n{\n\n if ($DEBUG) { \"--DEBUG-- Remote Creds: Converting user/pass to credential string\"}\n # Use remote powershell with wmi.user and wmi.pass. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $WMI_PASS -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $WMI_USER, $remote_pass;\n $session = New-PSSession -Credential $remote_credential -ComputerName $hostname\n}\nelse\n{\n \"WinRM disabled and not a local collector\"\n exit 1\n}\n#simple command to make sure remote session is alive\n$sessionCheck = Invoke-Command -Session $session -ScriptBlock {$env:computername} \n\n$ADForest = Invoke-Command -Session $session -ScriptBlock {Get-ADForest}\n$ADDomain = Invoke-Command -Session $session -ScriptBlock {Get-ADDomain}\n\n# There's a bug where the first command fails. Running it a second time to see if it fixes it.\n# check to see if the ADForest is blank If it is then try again.\nif (($ADForest.DomainNamingMaster -eq \"\") -or ($null -eq $ADForest.DomainNamingMaster) ){\n $ADForest = Invoke-Command -Session $session -ScriptBlock {Get-ADForest}\n}\n\n## Will hold discovered FSM roles\n$FSMO_Hash = @{\n \"Domain Naming Master\" = $ADForest.DomainNamingMaster;\n \"Schema Master\" = $ADForest.SchemaMaster;\n \"Infrastructure Master\" = $ADDomain.InfrastructureMaster;\n \"PDC Emulator\" = $ADDomain.PDCEmulator;\n \"RID Master\" = $ADDomain.RIDMaster;\n}\n## render output - sorted by name.\n$FSMO_HASH.GetEnumerator() | sort-object -Property Name |Format-Table -AutoSize | Out-String -Width 256\n\n\nif ($DEBUG) { \"--DEBUG-- Successful output\" }\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\nEXIT 0"}, "configChecks": [{"name": "anyChange", "description": "A change was detected in the configuration of Active Directory Organizational Units.", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}, {"name": "cantRetrieve", "description": "Unable to retrieve the Active Directory OU Configuration.", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Microsoft_ActiveDirectory_Forests (2330)

{"name": "Microsoft_ActiveDirectory_Forests", "description": "Active Directory Forest information.", "appliesTo": "hasCategory(\"MicrosoftDomainController\") && hasCategory(\"InfrastructureMaster\")", "group": "Active Directory Configs", "searchKeywords": "ad,active directory,configuration,microsoft", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-adforest?view=win10-ps", "displayedAs": "Forests", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n#\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = \"##SYSTEM.HOSTNAME##\".ToLower()\n$winRM = '##AUTO.WINRM##'.ToLower()\n\n## Debug flag\n$DEBUG = $false\n\n\n#$winRM will default to enabled since the property source that sets it isn't universal.\nif ($winRM -EQ '##auto.winrm##')\n{\n $winRM = 'enabled'\n}\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\")\n{\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName.ToLower()\n}\nif ($DEBUG) {\"--DEBUG-- Hostname: $hostname\"}\nif ($DEBUG) {\"--DEBUG-- PS Version: $( $PSVersionTable.PSVersion )\"}\nif ($DEBUG) {\"--DEBUG-- CollectorName $collectorName \"}\nif ($DEBUG) {\"--DEBUG-- winRM $winRM \"}\n\n## check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($HOSTNAME -like $COLLECTORNAME)\n{\n if ($DEBUG) { \"--DEBUG-- Hostname is equal Collector name\"}\n $session = New-PSSession\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($WMI_USER) -and [string]::IsNullOrWhiteSpace($WMI_PASS)) -or (($WMI_USER -like '*WMI.USER*') -and ($WMI_PASS -like '*WMI.PASS*') -and $winRM -eq 'enabled' ))\n{\n # no WMI password available. Use service name user and password\n if ($DEBUG) {\"--DEBUG-- Collector user being used.\"}\n $session = New-PSSession -ComputerName $hostname\n}\nelseif ($winRM -eq \"enabled\")\n{\n\n if ($DEBUG) { \"--DEBUG-- Remote Creds: Converting user/pass to credential string\"}\n # Use remote powershell with wmi.user and wmi.pass. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $WMI_PASS -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $WMI_USER, $remote_pass;\n $session = New-PSSession -Credential $remote_credential -ComputerName $hostname\n}\nelse\n{\n \"WinRM disabled and not a local collector\"\n exit 1\n}\n\n#simple command to make sure remote session is alive\n$sessionCheck = Invoke-Command -Session $session -ScriptBlock {$env:computername} \n\n$scriptBlock = {Get-ADForest | Select-Object * -ExcludeProperty RunspaceId, PropertyCount | Format-List | Out-String -Width 256}\n$returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n\n\n#try it again. Sometimes fails the first time\nif (($null -eq $returnData) -or ($returnData -eq \"\"))\n{\n $returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n}\n$returnData\n\n\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\nif ($DEBUG) { \"--DEBUG-- Successful output\" }\nEXIT 0"}, "configChecks": [{"name": "anyChange", "description": "A change was detected in the configuration or properties of the Active Directory Forest.", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}, {"name": "cantRetrieve", "description": "Unable to retrieve Active Directory Forest Configuration.", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Microsoft_ActiveDirectory_GroupPolicies (2329)

{"name": "Microsoft_ActiveDirectory_GroupPolicies", "description": "List all Group Policy objects and settings for a Windows domain.", "appliesTo": "hasCategory(\"MicrosoftDomainController\") && hasCategory(\"InfrastructureMaster\")", "group": "Active Directory Configs", "searchKeywords": "ad,active directory,configuration,microsoft", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/grouppolicy/Get-GPO?view=win10-ps", "displayedAs": "Group Policies", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n#\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = \"##SYSTEM.HOSTNAME##\".ToLower()\n$winRM = '##AUTO.WINRM##'.ToLower()\n\n## Debug flag\n$DEBUG = $false\n\n\n#$winRM will default to enabled since the property source that sets it isn't universal.\nif ($winRM -EQ '##auto.winrm##')\n{\n $winRM = 'enabled'\n}\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\")\n{\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName.ToLower()\n}\nif ($DEBUG) {\"--DEBUG-- Hostname: $hostname\"}\nif ($DEBUG) {\"--DEBUG-- PS Version: $( $PSVersionTable.PSVersion )\"}\nif ($DEBUG) {\"--DEBUG-- CollectorName $collectorName \"}\nif ($DEBUG) {\"--DEBUG-- winRM $winRM \"}\n\n## check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($HOSTNAME -like $COLLECTORNAME)\n{\n if ($DEBUG) { \"--DEBUG-- Hostname is equal Collector name\"}\n $session = New-PSSession\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($WMI_USER) -and [string]::IsNullOrWhiteSpace($WMI_PASS)) -or (($WMI_USER -like '*WMI.USER*') -and ($WMI_PASS -like '*WMI.PASS*') -and $winRM -eq 'enabled' ))\n{\n # no WMI password available. Use service name user and password\n if ($DEBUG) {\"--DEBUG-- Collector user being used.\"}\n $session = New-PSSession -ComputerName $hostname\n}\nelseif ($winRM -eq \"enabled\")\n{\n\n if ($DEBUG) { \"--DEBUG-- Remote Creds: Converting user/pass to credential string\"}\n # Use remote powershell with wmi.user and wmi.pass. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $WMI_PASS -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $WMI_USER, $remote_pass;\n $session = New-PSSession -Credential $remote_credential -ComputerName $hostname\n}\nelse\n{\n \"WinRM disabled and not a local collector\"\n exit 1\n}\n\n#simple command to make sure remote session is alive\n$sessionCheck = Invoke-Command -Session $session -ScriptBlock {$env:computername} \n\n$scriptBlock = {Get-GPO -All | Select-Object * -ExcludeProperty RunspaceId | Format-List | Out-String -Width 256}\n$returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n\n#try it again. Sometimes fails the first time\nif (($null -eq $returnData) -or ($returnData -eq \"\"))\n{\n $returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n}\n$returnData\n \n\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\nif ($DEBUG) { \"--DEBUG-- Successful output\" }\nEXIT 0"}, "configChecks": [{"name": "anyChange", "description": "A change was detected to the configuration or membership of Active Directory Group Policies.", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": ["<ReadTime>"], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}, {"name": "cantRetrieve", "description": "Unable to retrieve the list of Group Policies from Active Directory.", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Microsoft_ActiveDirectory_OrganizationalUnits (2344)

{"name": "Microsoft_ActiveDirectory_OrganizationalUnits", "description": "List of Active Directory Organizational Units.", "appliesTo": "hasCategory(\"MicrosoftDomainController\") && hasCategory(\"InfrastructureMaster\")", "group": "Active Directory Configs", "searchKeywords": "ad,active directory,configuration,microsoft", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-adobject?view=win10-ps", "displayedAs": "Organizational Units", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n#\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = \"##SYSTEM.HOSTNAME##\".ToLower()\n$winRM = '##AUTO.WINRM##'.ToLower()\n\n## Debug flag\n$DEBUG = $false\n\n#$winRM will default to enabled since the property source that sets it isn't universal.\nif ($winRM -EQ '##auto.winrm##')\n{\n $winRM = 'enabled'\n}\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\")\n{\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName.ToLower()\n}\nif ($DEBUG) {\"--DEBUG-- Hostname: $hostname\"}\nif ($DEBUG) {\"--DEBUG-- PS Version: $( $PSVersionTable.PSVersion )\"}\nif ($DEBUG) {\"--DEBUG-- CollectorName $collectorName \"}\nif ($DEBUG) {\"--DEBUG-- winRM $winRM \"}\n\n## check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($HOSTNAME -like $COLLECTORNAME)\n{\n if ($DEBUG) { \"--DEBUG-- Hostname is equal Collector name\"}\n $session = New-PSSession\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($WMI_USER) -and [string]::IsNullOrWhiteSpace($WMI_PASS)) -or (($WMI_USER -like '*WMI.USER*') -and ($WMI_PASS -like '*WMI.PASS*') -and $winRM -eq 'enabled' ))\n{\n # no WMI password available. Use service name user and password\n if ($DEBUG) {\"--DEBUG-- Collector user being used.\"}\n $session = New-PSSession -ComputerName $hostname\n}\nelseif ($winRM -eq \"enabled\")\n{\n\n if ($DEBUG) { \"--DEBUG-- Remote Creds: Converting user/pass to credential string\"}\n # Use remote powershell with wmi.user and wmi.pass. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $WMI_PASS -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $WMI_USER, $remote_pass;\n $session = New-PSSession -Credential $remote_credential -ComputerName $hostname\n}\nelse\n{\n \"WinRM disabled and not a local collector\"\n exit 1\n}\n\n#simple command to make sure remote session is alive\n$sessionCheck = Invoke-Command -Session $session -ScriptBlock {$env:computername} \n\n$scriptBlock = {Get-ADObject -Filter { (ObjectClass -eq 'organizationalunit') -or (ObjectClass -eq 'container') } -Properties Name, CanonicalName | Select-Object -Property CanonicalName | Sort-object CanonicalName | Format-Table -Autosize | Out-String -Width 256}\n$returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n\n\n#try it again. Sometimes fails the first time\nif (($null -eq $returnData) -or ($returnData -eq \"\"))\n{\n $returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n}\n$returnData\n\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\nif ($DEBUG) { \"--DEBUG-- Successful output\" }\nEXIT 0"}, "configChecks": [{"name": "anyChange", "description": "A change was detected in the configuration of Active Directory Organizational Units.", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}, {"name": "cantRetrieve", "description": "Unable to retrieve the Active Directory OU Configuration.", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Microsoft_ActiveDirectory_PasswordPolicy (2333)

{"name": "Microsoft_ActiveDirectory_PasswordPolicy", "description": "Analyzes the default domain password policy - and alerts on deviations from Microsoft best practice recommendations.", "appliesTo": "hasCategory(\"MicrosoftDomainController\") && hasCategory(\"InfrastructureMaster\")", "group": "Active Directory Configs", "searchKeywords": "ad,active directory,configuration,microsoft", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-addefaultdomainpasswordpolicy?view=win10-ps", "displayedAs": "Password Policy", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n#\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = \"##SYSTEM.HOSTNAME##\".ToLower()\n$winRM = '##AUTO.WINRM##'.ToLower()\n\n## Debug flag\n$DEBUG = $false\n\n#$winRM will default to enabled since the property source that sets it isn't universal.\nif ($winRM -EQ '##auto.winrm##')\n{\n $winRM = 'enabled'\n}\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\")\n{\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName.ToLower()\n}\nif ($DEBUG) {\"--DEBUG-- Hostname: $hostname\"}\nif ($DEBUG) {\"--DEBUG-- PS Version: $( $PSVersionTable.PSVersion )\"}\nif ($DEBUG) {\"--DEBUG-- CollectorName $collectorName \"}\nif ($DEBUG) {\"--DEBUG-- winRM $winRM \"}\n\n## check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($HOSTNAME -like $COLLECTORNAME)\n{\n if ($DEBUG) { \"--DEBUG-- Hostname is equal Collector name\"}\n $session = New-PSSession\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($WMI_USER) -and [string]::IsNullOrWhiteSpace($WMI_PASS)) -or (($WMI_USER -like '*WMI.USER*') -and ($WMI_PASS -like '*WMI.PASS*') -and $winRM -eq 'enabled' ))\n{\n # no WMI password available. Use service name user and password\n if ($DEBUG) {\"--DEBUG-- Collector user being used.\"}\n $session = New-PSSession -ComputerName $hostname\n}\nelseif ($winRM -eq \"enabled\")\n{\n\n if ($DEBUG) { \"--DEBUG-- Remote Creds: Converting user/pass to credential string\"}\n # Use remote powershell with wmi.user and wmi.pass. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $WMI_PASS -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $WMI_USER, $remote_pass;\n $session = New-PSSession -Credential $remote_credential -ComputerName $hostname\n}\nelse\n{\n \"WinRM disabled and not a local collector\"\n exit 1\n}\n\n$scriptBlock = {\n\n $boolean_hash = @{\n \"False\" = 0;\n \"True\" = 1;\n }\n\n #Retrieve the Default Domain Password Policy\n $pp = Get-ADDefaultDomainPasswordPolicy\n\n $ce = $boolean_hash[\"$($pp.ComplexityEnabled)\"]\n $rev = $boolean_hash[\"$($pp.ReversibleEncryptionEnabled)\"]\n\n ## Convert timestamps and save as variables.\n $ld = [TimeSpan]::Parse($pp.LockoutDuration)\n $lw = [TimeSpan]::Parse($pp.LockoutObservationWindow)\n $minpa = [TimeSpan]::Parse($pp.MinPasswordAge)\n $maxpa = [TimeSpan]::Parse($pp.MaxPasswordAge)\n\n $hash = @{\n \"Complexity Enabled\" = \"$($ce) ($($pp.ComplexityEnabled))\";\n \"Lockout Duration in Minutes\" = $ld.TotalMinutes;\n \"Lockout Observation Window in Minutes\" = $lw.TotalMinutes\n \"Lockout Threshold\" = \"$($pp.LockoutThreshold) Attempts\";\n \"Minimum Password Age in Days\" = $minpa.Days;\n \"Maximum Password Age in Days\" = $maxpa.Days;\n \"Minimum Password Length\" = \"$($pp.MinPasswordLength) Characters\";\n \"Password History Recollection Count\" = \"$($pp.PasswordHistoryCount) Passwords\";\n \"Reversible Encryption Enabled\" = \"$($rev) ($($pp.ReversibleEncryptionEnabled))\";\n }\n\n $hash.GetEnumerator() |Sort-Object -Property Name | Format-Table -AutoSize | Out-String -Width 256\n}\n\n\n#simple command to make sure remote session is alive\n$sessionCheck = Invoke-Command -Session $session -ScriptBlock {$env:computername} \n\n$returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n\n\n#try it again. Sometimes fails the first time\nif (($null -eq $returnData) -or ($returnData -eq \"\"))\n{\n $returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n}\n$returnData\n\n\n\nif ($DEBUG) { \"--DEBUG-- Successful output\"}\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\nEXIT 0"}, "configChecks": [{"name": "ComplexityEnabled", "description": "These facilities enforce the use of secure passwords.", "type": "value", "attrs": {"value": "Complexity\\sEnabled\\s+(\\d)\\s\\(\\w+\\)", "expr": "ne 1"}, "severity": "warn"}, {"name": "LockoutDurationMinutes", "description": "The Account lockout duration determines the number of minutes that a locked-out account remains locked out before automatically becoming unlocked. https://technet.microsoft.com/en-us/library/hh994569(v=ws.11).aspx", "type": "value", "attrs": {"value": "Lockout\\sDuration\\sin\\sMinutes\\s+(\\d+)", "expr": "lt 15"}, "severity": "warn"}, {"name": "LockoutObservationWindow", "description": "The range of time in which the system increments the incorrect logon count.", "type": "value", "attrs": {"value": "Lockout\\sObservation\\sWindow\\sin\\sMinutes\\s+(\\d+)", "expr": "lt 15"}, "severity": "warn"}, {"name": "LockoutThreshold", "description": "The Account lockout threshold policy setting determines the number of failed sign-in attempts that will cause a user account to be locked. https://technet.microsoft.com/en-us/library/hh994574(v=ws.11).aspx", "type": "value", "attrs": {"value": "Lockout\\sThreshold\\s+(\\d+)\\sAttempts", "expr": "lt 5"}, "severity": "warn"}, {"name": "MaxPasswordAgeDays", "description": "This determines how long users can keep a password before they have to change it. The aim is to force users to change their passwords periodically. Default alert threshold set here is 6 months (179 days.)", "type": "value", "attrs": {"value": "Maximum\\sPassword\\sAge\\sin\\sDays\\s+(\\d+)", "expr": "gt 180"}, "severity": "warn"}, {"name": "MinPasswordAgeDays", "description": "The Minimum password age policy setting determines the period of time (in days) that a password can be used before the system requires the user to change it.", "type": "value", "attrs": {"value": "Minimum\\sPassword\\sAge\\sin\\sDays\\s+(\\d+)", "expr": "lt 1"}, "severity": "warn"}, {"name": "MinPasswordLength", "description": "This sets the minimum number of characters for a password. If you haven\u2019t changed the default setting, you should do so immediately. https://technet.microsoft.com/en-us/library/ff741764.aspx", "type": "value", "attrs": {"value": "Minimum\\sPassword\\sLength\\s+(\\d+)\\sCharacters", "expr": "lt 7"}, "severity": "warn"}, {"name": "PasswordHistoryCount", "description": "This sets how frequently old passwords can be reused. With this policy, you can discourage users from alternating between several common passwords.", "type": "value", "attrs": {"value": "Password\\sHistory\\sRecollection\\sCount\\s+(\\d+)\\sPasswords", "expr": "lte 3"}, "severity": "warn"}, {"name": "ReversibleEncryptionEnabled", "description": "Storing encrypted passwords in a way that is reversible means that the encrypted passwords can be decrypted. https://technet.microsoft.com/en-us/library/hh994559(v=ws.11).aspx", "type": "value", "attrs": {"value": "Reversible\\sEncryption\\sEnabled\\s+(\\d)\\s\\(\\w+\\)", "expr": "ne 0"}, "severity": "warn"}, {"name": "anyChange", "description": "A change to Active Directory Password Policy was detected.", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}, {"name": "cantRetrieve", "description": "", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Microsoft_ActiveDirectory_SitesSubnets (2342)

{"name": "Microsoft_ActiveDirectory_SitesSubnets", "description": "Active Directory Sites and Subnets configuration information.", "appliesTo": "hasCategory(\"MicrosoftDomainController\") && hasCategory(\"InfrastructureMaster\")", "group": "Active Directory Configs", "searchKeywords": "ad,active directory,configuration,microsoft", "technicalNotes": "https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-adreplicationsubnet?view=win10-ps", "displayedAs": "Sites and Subnets", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n#\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = \"##SYSTEM.HOSTNAME##\".ToLower()\n$winRM = '##AUTO.WINRM##'.ToLower()\n\n## Debug flag\n$DEBUG = $false\n\n#$winRM will default to enabled since the property source that sets it isn't universal.\nif ($winRM -EQ '##auto.winrm##')\n{\n $winRM = 'enabled'\n}\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\")\n{\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName.ToLower()\n}\nif ($DEBUG) {\"--DEBUG-- Hostname: $hostname\"}\nif ($DEBUG) {\"--DEBUG-- PS Version: $( $PSVersionTable.PSVersion )\"}\nif ($DEBUG) {\"--DEBUG-- CollectorName $collectorName \"}\nif ($DEBUG) {\"--DEBUG-- winRM $winRM \"}\n\n## check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($HOSTNAME -like $COLLECTORNAME)\n{\n if ($DEBUG) { \"--DEBUG-- Hostname is equal Collector name\"}\n $session = New-PSSession\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($WMI_USER) -and [string]::IsNullOrWhiteSpace($WMI_PASS)) -or (($WMI_USER -like '*WMI.USER*') -and ($WMI_PASS -like '*WMI.PASS*') -and $winRM -eq 'enabled' ))\n{\n # no WMI password available. Use service name user and password\n if ($DEBUG) {\"--DEBUG-- Collector user being used.\"}\n $session = New-PSSession -ComputerName $hostname\n}\nelseif ($winRM -eq \"enabled\")\n{\n\n if ($DEBUG) { \"--DEBUG-- Remote Creds: Converting user/pass to credential string\"}\n # Use remote powershell with wmi.user and wmi.pass. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $WMI_PASS -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $WMI_USER, $remote_pass;\n $session = New-PSSession -Credential $remote_credential -ComputerName $hostname\n}\nelse\n{\n \"WinRM disabled and not a local collector\"\n exit 1\n}\n\n$scriptBlock = {Get-ADReplicationSubnet -Filter * | Format-List}\n\n#simple command to make sure remote session is alive\n$sessionCheck = Invoke-Command -Session $session -ScriptBlock {$env:computername} \n\n$returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n\n#try it again. Sometimes fails the first time\nif (($null -eq $returnData) -or ($returnData -eq \"\"))\n{\n $returnData = Invoke-Command -Session $session -ScriptBlock $scriptBlock\n}\n$returnData\n\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\nif ($DEBUG) { \"--DEBUG-- Successful output\"}\nEXIT 0"}, "configChecks": [{"name": "anyChange", "description": "A change was detected in the configuration or properties of the Active Directory Sites and Subnets.", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 60}, "severity": "warn"}, {"name": "cantRetrieve", "description": "Unable to retrieve Active Directory Sites and Subnets Configuration.", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Oracle_Database_TableSpaceStatus (918)

{"name": "Oracle_Database_TableSpaceStatus", "description": "Displays the status of the tablespace", "appliesTo": "hasCategory(\"OracleDB\")", "searchKeywords": "database,oracle,tablespace", "technicalNotes": "For additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle TableSpace Status", "collectionInterval": "1m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n */\n\nimport groovy.sql.Sql\n\ndef host = hostProps.get(\"system.hostname\")\ndef wildvalue = \"\"\ndef wildAlias = \"\"\ndef ILP = \"\"\n\ndef queryOutput = [:]\ndef conn = [:]\n\n// go grab all the database names\ndef displayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\n\ndef sqlQuery = 'SELECT TABLESPACE_NAME, BLOCK_SIZE FROM DBA_TABLESPACES ' +\n 'Where TABLESPACE_NAME != \\'UNDOTBS1\\'' //exclude the undotbs1. It should always be almost full in an active DB.\n\ndbnamesList.each { dbname ->\n def user = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n def pass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n def port = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n //attempt to make a connection.\n conn = attemptConnection(host, port, dbname, user, pass)\n\n if (conn.status == 'success')\n {\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n\n queryOutput[\"data\"].each { data ->\n wildvalue = \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}||${data.TABLESPACE_NAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n wildAlias = \"${data.TABLESPACE_NAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")} (${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")})\"\n ILP = \"auto.blocksize=${data.BLOCK_SIZE}&auto.databasename=${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n\n println \"${wildvalue}##${wildAlias}######${ILP}\"\n }\n }\n }\n\n // always close the connection\n if (conn.status == 'success')\n {\n conn.connection.close()\n }\n}\n\nreturn 0\n\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}"}, "groupMethod": "ilp", "groupExpr": "auto.databasename"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2019 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n/*\nsome of the information here is from this site:\nhttps://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13719\n\n*/\nimport groovy.sql.Sql\n// Enable debug mode for troubleshooting purposes. Otherwise, leave false\nBoolean debug = false\n\n\ndef host = hostProps.get(\"system.hostname\")\ndef queryOutput = [:]\ndef conn = [:]\n// go grab all the database names\ndef displayName = hostProps.get(\"system.displayname\")\ndef dbnamesList = []\n\n// check manually set dbnames\ndbnames = hostProps.get(\"oracle.dbnames\")?:\"\"\ndbnamesList = dbnames.toString().tokenize(\",\")\n\n//check auto dbnames\ndbnames= (hostProps.get(\"auto.oracle.dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbnames field for backward compatability\ndbnames= (hostProps.get(\"dbnames\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n//check old dbname field for backward compatability\ndbnames= (hostProps.get(\"dbname\") ?:\"\")\ndbnamesList = dbnamesList + dbnames.toString().tokenize(\",\")\n\n// remove any duplicates\ndbnamesList = dbnamesList.unique { a, b -> a <=> b }\n\nif (dbnamesList == [])\n{\n return 0\n}\n\ndef sqlQuery = \"\"\"select TABLESPACE_NAME,\n case when STATUS = 'ONLINE' then 0\n when STATUS = 'READ ONLY' then 1\n when STATUS = 'OFFLINE' then 2\n else 3\n end as STATUS \n from dba_tablespaces\n \"\"\"\nLMDebugPrint(sqlQuery,debug)\n\ndbnamesList.each { dbname ->\n def user = hostProps.get(\"oracle.${dbname.trim()}.user\") ?: hostProps.get(\"jdbc.oracle.user\")\n def pass = hostProps.get(\"oracle.${dbname.trim()}.password\") ?: hostProps.get(\"jdbc.oracle.pass\")\n def port = hostProps.get(\"oracle.${dbname.trim()}.port\")?.toInteger() ?: (hostProps.get(\"jdbc.oracle.port\")?.toInteger() ?: 1521)\n\n //attempt to make a connection.\n conn = attemptConnection(host, port, dbname, user, pass)\n LMDebugPrint(\"Connection Status: ${conn}\",debug)\n if (conn.status == 'success')\n {\n queryOutput = runQuery(sqlQuery, conn['connection'])\n\n if (queryOutput.status == \"Success\")\n {\n queryOutput[\"data\"].each { data ->\n LMDebugPrint(data,debug)\n def wildvalue = \"${dbname.trim().replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}||${data.TABLESPACE_NAME.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")}\"\n println \"${wildvalue}.STATUS=${data.STATUS}\"\n }\n }\n }\n\n // always close the connection\n if (conn.status == 'success')\n {\n conn.connection.close()\n }\n}\n\nreturn 0\n/**\n * Helper method which handles creating a connection to the jdbc database\n * @returnArray is an array with a connection, status and any error messages an array.\n * *connection = jdbc connection\n * *status, success or fail\n * *errors, if both connection types fail there will be 2 error messages.\n *\n */\ndef attemptConnection(inHost,inPort,inName , inUser, inPass )\n{\n def returnArray = [:]\n def errors = []\n def connComplete\n def db_connection\n\n try\n {\n def url = \"jdbc:oracle:thin:@${inHost}:${inPort}:${inName}\" //url in SID format\n // Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n // Create a connection to the database.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[0] = e.message\n connComplete = false\n }\n\n// Connection creation thrown into Try/Catch block as to quickly capture any issues with initial connection.\n// Create a connection to the database.\n if (connComplete == false)\n {\n try\n {\n url = \"jdbc:oracle:thin:@${inHost}:${inPort}/${inName}\" //url in database name format.\n db_connection = Sql.newInstance(url, inUser, inPass, \"oracle.jdbc.driver.OracleDriver\")\n connComplete = true\n }\n catch (Exception e)\n {\n // Print out the exception and exit with 1.\n errors[1] = e.message\n connComplete = false\n }\n }\n\n // populate the connection and any messages for the return array\n if (connComplete == true) {\n\n returnArray['connection'] = db_connection\n returnArray['status'] = 'success'\n }\n else\n {\n returnArray['status'] = 'failed'\n returnArray['errors'] = errors\n }\n\n return returnArray\n\n}\n\n/*\nEnd of attemptConnection\n */\n\n\n/*\nAttempt to execute SQL command.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQuery(String sqlQuery, conn )\n{\n returnArray = [:]\n // query the Oracle DB.\n try{\n\n returnArray['data'] = conn.rows(sqlQuery)\n returnArray['status'] = 'Success'\n returnArray['error'] = ''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n\n/*\nAttempt to execute SQL command that doesn't return any data.\nReturns an array.\n the first element is the query data\n second element is success or fail\n third element is the error message\n */\ndef runQueryNoReturn(String sqlQuery, conn)\n{\n\n returnArray = [:]\n // query the Oracle DB.\n try{\n returnArray['data'] = conn.execute(sqlQuery)\n returnArray['status'] = \"Success\"\n returnArray['error']=''\n }\n catch (Exception e)\n {\n returnArray['error'] = e.message\n returnArray['status'] ='Failed'\n }\n\n return returnArray\n}\n\n\n/**\n * Helper method to print out debug messages for troubleshooting purposes.\n * @param message\n * @param debug\n * @return\n */\n\ndef LMDebugPrint(message, debug = false)\n{\n if (debug)\n {\n println(message)\n }\n}"}, "datapoints": [{"name": "Status", "description": "status of the tablespace \n0= online \n1= read only\n2=offline", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.STATUS", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "> 0 0", "noData": "Trigger warning alert", "triggerInterval": 3, "clearInterval": 3, "alertBody": "The host ##HOST## with Database name and Table Space ##WILDALIAS## has been marked offline with a value of ##VALUE## percent usage putting the Table Space in and alert. This started at ##START##, or ##DURATION## ago.\n\nThe alert is set to start at ##LEVEL##\n\nAvailable Status codes\n0= online \n1= read only\n2=offline"}], "graphs": [{"name": "Tablespace status", "title": "Status", "verticalLabel": "status code", "min": -1.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Status 2=offline, 1=read only, 0=online", "color": "silver", "datapointName": "Status", "isVirtual": false}]}]}

×DataSource: Win_HyperV_VirtualMachines (38)

{"name": "Win_HyperV_VirtualMachines", "description": "HyperV virtual machine summary statistics for Windows Server 2008 and later.", "appliesTo": "hasCategory(\"HyperV\") && !(hasCategory(\"WSFC_VNN\") || hasCategory(\"NLB_VNN\")) ", "searchKeywords": "os,vm,hyper-v,windows,hyperv", "technicalNotes": "- Correlating boot drive to VM is based on VM name; renaming a VM will break linkage between WMI components.\n- Baseline monitoring doesn't allow for complete view of VM memory.\n- State operationalStatus, and Instance Level Properties require winrm to be enabled and hyperv cmdlets to be responsive.", "displayedAs": "HyperV Virtual Machines", "collectionInterval": "3m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n# Initialize Variables\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = '##SYSTEM.HOSTNAME##'\n$collectorName = hostname\n$winrmenabled = '##AUTO.WINRM##'\n$os_major_version = '##AUTO.OS.VERSION.MAJOR##'\n$os_minor_version = '##AUTO.OS.VERSION.MINOR##'\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\") {\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName\n}\n\n$scriptblock = {\n $vmlist = @()\n $vms = Get-VM -Name *\n foreach ($vm in $vms) {\n $vminfo = $vm | Select-Object *\n $vmlist += @{\n id = $vminfo.Id\n name = $vminfo.name\n version = $vminfo.Version\n assignedmemory = [math]::Round(($vminfo.memoryassigned / 1024 / 1024 / 1024), 2) # GB\n CPUCount = $vminfo.ProcessorCount\n DiskCount = $vminfo.HardDrives.Count\n dynamicMemory = $vminfo.DynamicMemoryEnabled # True/False\n generation = $vminfo.VirtualMachineSubType # Generation1 vs Generation2\n resourceMeteringEnabled = $vminfo.ResourceMeteringEnabled # True/False\n notes = $vminfo.Notes\n IP = (Get-VMNetworkAdapter -VM $vm)[0].IPAddresses[0]\n }\n }\n return $vmlist\n}\n\n$SessionParams = @{\n ErrorAction = 'Stop'\n}\n$invokeParams = @{\n ErrorAction = 'SilentlyContinue'\n ScriptBlock = $scriptblock\n}\n\n$Opt = New-CimSessionOption -Protocol Dcom\n#-----Determin the type of query to make-----\n# check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($hostname -match $collectorName) {\n \n #Do nothing\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($wmi_user) -and [string]::IsNullOrWhiteSpace($wmi_pass)) -or (($wmi_user -like '*WMI.USER*') -and ($wmi_pass -like '*WMI.PASS*'))) {\n \n $SessionParams.ComputerName = $hostname\n $invokeParams.computerName = $hostname\n if ($winrmenabled -notlike 'enabled') {\n $SessionParams.SessionOption = $Opt\n }\n}\nelse {\n\n $SessionParams.ComputerName = $hostname\n # yes. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $wmi_pass -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $wmi_user, $remote_pass;\n $SessionParams.Credential = $remote_credential\n $invokeParams.Credential = $remote_credential\n\n if ($winrmenabled -notlike 'enabled') {\n $SessionParams.SessionOption = $Opt\n }\n}\n\nif (!$os_major_version -or !$os_minor_version) {\n Write-Host \"Datasource requires the properties AUTO.OS.VERSION.MAJOR and AUTO.OS.VERSION.MINOR, set through the propertysource Device_BasicInfo. Please ensure these are set.\"\n Return 1\n}\n\n$vmlist = Invoke-Command @invokeParams\n\n$session = New-CimSession @SessionParams\n# get the vm details\nif ($os_major_version -eq 6 -and $os_minor_version -lt 2) {\n $vm_details = Get-CimInstance -CimSession $Session -ClassName MSVM_Computersystem -Namespace root\\virtualization | ? { $_.Caption -eq \"Virtual Machine\" }\n}\nelse {\n $vm_details = Get-CimInstance -CimSession $Session -ClassName MSVM_Computersystem -Namespace root\\virtualization\\v2 | ? { $_.Caption -eq \"Virtual Machine\" }\n}\n\n# iterate through each vm\nforeach ($vm in $vm_details) {\n # print the instance details\n $vm_name = $vm.ElementName;\n $vm_id = $vm.Name;\n $wildvalue = \"${vm_id}/${vm_name}\".replace(' ', '_');\n $ILPS = \"predef.externalResourceID=${wildvalue},hyperv--vm--${vm_name}&predef.externalResourceType=VirtualMachine\"\n $description = \"\"\n\n if ($vmlist) {\n $vminfo = $vmlist | Where-Object { $_.name -like $vm_name -and $_.id -like $vm_id }\n $description = \"$($vminfo.CPUCount) CPU / $($vminfo.assignedmemory) GB RAM / $($vminfo.DiskCount) Disk(s)\"\n foreach ($key in $vminfo.Keys) {\n $value = $vminfo[$key]\n if ($value) {\n $ILPS += \"&$key=$value\"\n }\n }\n }\n\n Write-Host \"$wildvalue##$vm_name##$description####$ILPS\"\n}\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\n\nExit 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n# Initialize Variables\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = '##SYSTEM.HOSTNAME##'\n$collectorName = hostname\n$winrmenabled = '##AUTO.WINRM##'\n$os_major_version = '##AUTO.OS.VERSION.MAJOR##'\n$os_minor_version = '##AUTO.OS.VERSION.MINOR##'\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\") {\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName\n}\n\n$scriptblock = {\n $vmlist = @()\n $vms = Get-VM -Name *\n $statearray = @(\n \"Other\"\n \"Running\"\n \"Off\"\n \"Stopping\"\n \"Saved\"\n \"Paused\"\n \"Starting\"\n \"Reset\"\n \"Saving\"\n \"Pausing\"\n \"Resuming\"\n \"FastSaved\"\n \"FastSaving\"\n \"RunningCritical\"\n \"OffCritical\"\n \"StoppingCritical\"\n \"SavedCritical\"\n \"PausedCritical\"\n \"StartingCritical\"\n \"ResetCritical\"\n \"SavingCritical\"\n \"PausingCritical\"\n \"ResumingCritical\"\n \"FastSavedCritical\"\n \"FastSavingCritical\"\n )\n $operationalStatusarray = @(\n \"Ok\"\n \"Degraded\"\n \"PredictiveFailure\"\n \"InService\"\n \"Dormant\"\n \"SupportingEntityInError\"\n \"ApplyingSnapshot\"\n \"CreatingSnapshot\"\n \"DeletingSnapshot\"\n \"WaitingToStart\"\n \"MergingDisks\"\n \"ExportingVirtualMachine\"\n \"MigratingVirtualMachine\"\n \"BackingUpVirtualMachine\"\n \"ModifyingUpVirtualMachine\"\n \"StorageMigrationPhaseOne\"\n \"StorageMigrationPhaseTwo\"\n \"MigratingPlannedVm\"\n \"CheckingCompatibility\"\n \"ApplicationCriticalState\"\n \"CommunicationTimedOut\"\n \"CommunicationFailed\"\n \"NoIommu\"\n \"NoIovSupportInNic\"\n \"SwitchNotInIovMode\"\n \"IovBlockedByPolicy\"\n \"IovNoAvailResources\"\n \"IovGuestDriversNeeded\"\n \"CriticalIoError\"\n )\n foreach ($vm in $vms) {\n $vminfo = $vm | Select-Object *\n $statearray | % { $counter = 0 } { if ($vminfo.state -like $_) { $state = $counter }; $counter++ }\n $operationalStatusarray | % { $counter = 0 } { if ($vminfo.operationalStatus[0] -like $_) { $operationalStatus = $counter }; $counter++ }\n $vmlist += @{\n id = $vminfo.Id\n name = $vminfo.name\n state = $state\n operationalStatus = $operationalStatus\n }\n }\n return $vmlist\n}\n\n$SessionParams = @{\n ErrorAction = 'Stop'\n ComputerName = $hostname\n}\n$invokeParams = @{\n ErrorAction = 'SilentlyContinue'\n ScriptBlock = $scriptblock\n computerName = $hostname\n}\n\n$Opt = New-CimSessionOption -Protocol Dcom\n#-----Determin the type of query to make-----\n# check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($hostname -match $collectorName) {\n\n #Do nothing\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($wmi_user) -and [string]::IsNullOrWhiteSpace($wmi_pass)) -or (($wmi_user -like '*WMI.USER*') -and ($wmi_pass -like '*WMI.PASS*'))) {\n\n if ($winrmenabled -notlike 'enabled') {\n $SessionParams.SessionOption = $Opt\n }\n}\nelse {\n # yes. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $wmi_pass -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $wmi_user, $remote_pass;\n $SessionParams.Credential = $remote_credential\n $invokeParams.Credential = $remote_credential\n\n if ($winrmenabled -notlike 'enabled') {\n $SessionParams.SessionOption = $Opt\n }\n}\n\n$session = New-CimSession @SessionParams\nif (!$os_major_version -or !$os_minor_version) {\n Write-Host \"Datasource requires the properties AUTO.OS.VERSION.MAJOR and AUTO.OS.VERSION.MINOR, set through the propertysource Device_BasicInfo. Please ensure these are set.\"\n Return 1\n}\n\nif ($os_major_version -eq 10 -and $os_minor_version -eq 0) {\n $vm_details = Get-CimInstance -CimSession $Session -ClassName MSVM_Computersystem -Namespace 'root\\virtualization\\v2' | ? { $_.Caption -eq \"Virtual Machine\" };\n\n $vm_status = Get-CimInstance -CimSession $Session -ClassName MSVM_Computersystem -Namespace 'root\\virtualization\\v2'\n\n $vm_cpu = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_HvStats_HyperVHypervisorVirtualProcessor -Namespace root\\CIMV2\n\n $vm_hvpt = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_HvStats_HyperVHypervisorPartition -Namespace root\\CIMV2\n\n $vm_disk = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_Counters_HyperVVirtualStorageDevice -Namespace root\\CIMV2\n\n $vm_mem = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_BalancerStats_HyperVDynamicMemoryVM -Namespace root\\CIMV2\n\n $vm_net = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_NvspNicStats_HyperVVirtualNetworkAdapter -Namespace root\\CIMV2\n}\nelseif ($os_major_version -eq 6 -and $os_minor_version -eq 3) {\n $vm_details = Get-CimInstance -CimSession $Session -ClassName MSVM_Computersystem -Namespace 'root\\virtualization\\v2' | ? { $_.Caption -eq \"Virtual Machine\" };\n\n $vm_status = Get-CimInstance -CimSession $Session -ClassName MSVM_Computersystem -Namespace 'root\\virtualization\\v2'\n\n $vm_cpu = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor -Namespace root\\CIMV2\n\n $vm_hvpt = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_HvStats_HyperVHypervisorPartition -Namespace root\\CIMV2\n\n $vm_disk = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_Counters_HyperVVirtualStorageDevice -Namespace root\\CIMV2\n\n $vm_mem = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_BalancerStats_HyperVDynamicMemoryVM -Namespace root\\CIMV2\n\n $vm_net = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_NvspNicStats_HyperVVirtualNetworkAdapter -Namespace root\\CIMV2\n}\nelseif ($os_major_version -eq 6 -and $os_minor_version -eq 2) {\n $vm_details = Get-CimInstance -CimSession $Session -ClassName MSVM_Computersystem -Namespace 'root\\virtualization\\v2' | ? { $_.Caption -eq \"Virtual Machine\" };\n\n $vm_status = Get-CimInstance -CimSession $Session -ClassName MSVM_Computersystem -Namespace 'root\\virtualization\\v2'\n\n $vm_cpu = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_HvStats_HyperVHypervisorVirtualProcessor -Namespace root\\CIMV2\n\n $vm_hvpt = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_HvStats_HyperVHypervisorPartition -Namespace root\\CIMV2\n\n $vm_disk = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_StorageStats_HyperVVirtualStorageDevice -Namespace root\\CIMV2\n\n $vm_mem = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_BalancerStats_HyperVDynamicMemoryVM -Namespace root\\CIMV2\n\n $vm_net = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_NvspNicStats_HyperVVirtualNetworkAdapter -Namespace root\\CIMV2\n}\nelseif ($os_major_version -eq 6 -and $os_minor_version -eq 1) {\n $vm_details = Get-CimInstance -CimSession $Session -ClassName MSVM_Computersystem -Namespace 'root\\virtualization' | ? { $_.Caption -eq \"Virtual Machine\" };\n\n $vm_status = Get-CimInstance -CimSession $Session -ClassName MSVM_Computersystem -Namespace 'root\\virtualization'\n\n $vm_cpu = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_HvStats_HyperVHypervisorVirtualProcessor -Namespace root\\CIMV2\n\n $vm_hvpt = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_HvStats_HyperVHypervisorPartition -Namespace root\\CIMV2\n\n $vm_ide = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_IdePerfProvider_HyperVVirtualIDEController -Namespace root\\CIMV2\n\n $vm_mem = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_BalancerStats_HyperVDynamicMemoryVM -Namespace root\\CIMV2\n\n $vm_net = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_NvspNicStats_HyperVVirtualNetworkAdapter -Namespace root\\CIMV2\n}\nelseif ($os_major_version -eq 6 -and $os_minor_version -eq 0) {\n $vm_details = Get-CimInstance -CimSession $Session -ClassName MSVM_Computersystem -Namespace 'root\\virtualization' | ? { $_.Caption -eq \"Virtual Machine\" };\n\n $vm_status = Get-CimInstance -CimSession $Session -ClassName MSVM_Computersystem -Namespace 'root\\virtualization'\n\n $vm_cpu = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_HvStats_HyperVHypervisorVirtualProcessor -Namespace root\\CIMV2\n\n $vm_hvpt = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_HvStats_HyperVHypervisorPartition -Namespace root\\CIMV2\n\n $vm_ide = Get-CimInstance -CimSession $Session -ClassName Win32_PerfRawData_IdePerfProvider_HyperVVirtualIDEController -Namespace root\\CIMV2\n}\n\n$vmlist = Invoke-Command @invokeParams\n\n# iterate through each vm\nforeach ($vm in $vm_details) {\n # define the instance details\n $vm_name = $vm.ElementName;\n $vm_id = $vm.Name;\n $wildvalue = \"${vm_id}/${vm_name}\".replace(' ', '_');\n\n Write-Host \"====== ${vm_name} ======\"\n\n if ($vmlist) {\n $vminfo = $vmlist | Where-Object { $_.name -like $vm_name -and $_.id -like $vm_id }\n if ($vminfo) {\n Write-Host \"$wildvalue.state=$($vminfo.state)\"\n Write-Host \"$wildvalue.operationalStatus=$($vminfo.operationalStatus)\"\n }\n }\n # iterate over the vm status objects\n foreach ($status in $vm_status) {\n $status_filter = $vm_id;\n\n # is this the object data for this vm\n if ($status.name -eq $status_filter) {\n # yes -- write it\n $enabledstate = $status.EnabledState;\n\n Write-Host \"${wildvalue}.EnabledState=${enabledstate}\"\n }\n }\n\n $TotalPercentTotalRunTime = 0;\n $TotalPercentGuestRunTime = 0;\n $TotalPercentHypervisorRunTime = 0;\n $cpu_count = 0;\n $cpu_timestampPerftime = 0\n $cpu_frequencyPerftime = 0\n\n # iterate over the vm cpu objects\n foreach ($cpu in $vm_cpu) {\n\n $cpu_filter = \"${vm_name}:Hv VP*\";\n\n # is this the object data for this vm\n if ($cpu.name -match $cpu_filter) {\n # yes\n $TotalPercentTotalRunTime = $TotalPercentTotalRunTime + $cpu.PercentTotalRunTime;\n $TotalPercentGuestRunTime = $TotalPercentGuestRunTime + $cpu.PercentGuestRunTime;\n $TotalPercentHypervisorRunTime = $TotalPercentHypervisorRunTime + $cpu.PercentHypervisorRunTime;\n\n $cpu_timestampPerftime = $cpu.Timestamp_PerfTime\n $cpu_frequencyPerftime = $cpu.Frequency_PerfTime\n\n $cpu_count++;\n }\n }\n\n if ($cpu_count -gt 0) {\n # 2012 R2 requires a special calculation for accurate runtime values: https://docs.microsoft.com/en-us/archive/blogs/tvoellm/how-to-get-processor-utilization-for-hyper-v-via-wmi\n if ($os_major_version -eq 6 -and $os_minor_version -eq 3){\n $MeanPercentTotalRunTime = ( $cpu_frequencyPerftime * $TotalPercentTotalRunTime ) / ( $cpu_count * $cpu_timestampPerftime * 100000 );\n $MeanPercentGuestRunTime = ( $cpu_frequencyPerftime * $TotalPercentGuestRunTime ) / ( $cpu_count * $cpu_timestampPerftime * 100000 );\n $MeanPercentHypervisorRunTime = ( $cpu_frequencyPerftime * $TotalPercentHypervisorRunTime ) / ( $cpu_count * $cpu_timestampPerftime * 100000 );\n } else {\n $MeanPercentTotalRunTime = $TotalPercentTotalRunTime / $cpu_count;\n $MeanPercentGuestRunTime = $TotalPercentGuestRunTime / $cpu_count;\n $MeanPercentHypervisorRunTime = $TotalPercentHypervisorRunTime / $cpu_count;\n }\n\n Write-Host \"${wildvalue}.MeanPercentTotalRunTime=${MeanPercentTotalRunTime}\";\n Write-Host \"${wildvalue}.MeanPercentGuestRunTime=${MeanPercentGuestRunTime}\";\n Write-Host \"${wildvalue}.MeanPercentHypervisorRunTime=${MeanPercentHypervisorRunTime}\";\n }\n else {\n Write-Host \"#### NO CPU FOUND ####\";\n }\n\n # iterate over the vm memory partition objects\n foreach ($hvpt in $vm_hvpt) {\n $hvpt_filter = \"${vm_name}:HvPt\";\n\n # is this the object data for this vm\n if ($hvpt.name -eq $hvpt_filter) {\n # yes -- write it\n $DepositedPages = $hvpt.DepositedPages;\n $GPApages = $hvpt.GPApages;\n $VirtualTLBPages = $hvpt.VirtualTLBPages;\n\n Write-Host \"${wildvalue}.DepositedPages=${DepositedPages}\";\n Write-Host \"${wildvalue}.GPApages=${PercentGuestRunTime}\";\n Write-Host \"${wildvalue}.VirtualTLBPages=${VirtualTLBPages}\";\n }\n }\n\n # iterate over the vm ide objects\n foreach ($disk in $vm_disk) {\n $disk_filter = \"${vm_name}.*vhd*\";\n\n # is this the object data for this vm\n if ($disk.name -match $disk_filter) {\n\n # yes -- write it\n $ReadBytesPersec = $disk.ReadBytesPersec;\n $WriteBytesPersec = $disk.WriteBytesPersec;\n $ReadCount = $disk.ReadCount;\n $WriteCount = $disk.WriteCount;\n\n\n Write-Host \"${wildvalue}.ReadBytesPersec=${ReadBytesPersec}\";\n Write-Host \"${wildvalue}.WriteBytesPersec=${WriteBytesPersec}\";\n Write-Host \"${wildvalue}.ReadCount=${ReadCount}\";\n Write-Host \"${wildvalue}.WriteCount=${WriteCount}\";\n }\n }\n\n # iterate over the vm memory objects\n foreach ($mem in $vm_mem) {\n $mem_filter = ${vm_name};\n\n # is this the object data for this vm\n if ($mem.name -like $mem_filter) {\n\n # yes -- write it\n $AveragePressure = $mem.AveragePressure;\n $CurrentPressure = $mem.CurrentPressure;\n $GuestVisiblePhysicalMemory = $mem.GuestVisiblePhysicalMemory;\n $MaximumPressure = $mem.MaximumPressure;\n $MinimumPressure = $mem.MinimumPressure;\n $PhysicalMemory = $mem.PhysicalMemory;\n\n Write-Host \"${wildvalue}.AveragePressure=${AveragePressure}\";\n Write-Host \"${wildvalue}.CurrentPressure=${CurrentPressure}\";\n Write-Host \"${wildvalue}.GuestVisiblePhysicalMemory=${GuestVisiblePhysicalMemory}\";\n Write-Host \"${wildvalue}.MaximumPressure=${MaximumPressure}\";\n Write-Host \"${wildvalue}.MinimumPressure=${MinimumPressure}\";\n Write-Host \"${wildvalue}.PhysicalMemory=${PhysicalMemory}\";\n\n }\n }\n\n $TotalBytesReceivedPerSec = 0;\n $TotalPacketsReceivedPerSec = 0;\n $TotalBytesSentPerSec = 0;\n $TotalPacketsSentPerSec = 0;\n $nic_count = 0;\n\n # iterate over the vm network adapter objects\n foreach ($net in $vm_net) {\n $net_filter = ${vm_id};\n\n # is this the object data for this vm\n if ($net.name -match $net_filter) {\n # yes\n $TotalBytesReceivedPerSec = $TotalBytesReceivedPerSec + $net.BytesReceivedPerSec;\n $TotalPacketsReceivedPerSec = $TotalPacketsReceivedPerSec + $net.PacketsReceivedPerSec;\n $TotalBytesSentPerSec = $TotalBytesSentPerSec + $net.BytesSentPerSec;\n $TotalPacketsSentPerSec = $TotalPacketsSentPerSec + $net.PacketsSentPerSec;\n $nic_count++;\n }\n }\n\n if ( $nic_count -gt 0 ) {\n $MeanBytesReceivedPerSec = $TotalBytesReceivedPerSec / $nic_count;\n $MeanPacketsReceivedPerSec = $TotalPacketsReceivedPerSec / $nic_count;\n $MeanBytesSentPerSec = $TotalBytesSentPerSec / $nic_count;\n $MeanPacketsSentPerSec = $TotalPacketsSentPerSec / $nic_count;\n\n Write-Host \"${wildvalue}.MeanBytesReceivedPerSec=${MeanBytesReceivedPerSec}\";\n Write-Host \"${wildvalue}.MeanPacketsReceivedPerSec=${MeanPacketsReceivedPerSec}\";\n Write-Host \"${wildvalue}.MeanBytesSentPerSec=${MeanBytesSentPerSec}\";\n Write-Host \"${wildvalue}.MeanPacketsSentPerSec=${MeanPacketsSentPerSec}\";\n }\n else {\n Write-Host \"#### NO NIC FOUND ####\";\n }\n}\n\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\n\nExit 0"}, "datapoints": [{"name": "AveragePressure", "description": "The average memory pressure on this VM; a ratio of how much memory the VM wants to the amount of memory the VM has been allocated", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.AveragePressure", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 90 100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 3, "alertBody": "The average memory pressure on Hyper-V VM ##INSTANCE## (##DSIDESCRIPTION##) on host ##HOST## is now at ##VALUE##, which puts this device in a ##LEVEL## state.\n\nThis began at ##START## -- or ##DURATION## ago.\n\nConsider increasing the memory allocated to this VM or reduce its workload."}, {"name": "EnabledState", "description": "Operational status code.\n\nStatus Codes:\n\n0=Unknown\n2=Running\n3=Disabled\n4=Shut Down\n6=Offline\n7=Test\n8=Defe\n9=Quiesce\n10=Reboot\n11=Reset\n32768=Paused\n32769=Suspended\n32770=Starting\n32771=Snapshotting\n32769=Applying Snapshot\n32773=Saving\n32774=Stopping\n32776=Pausing\n32777=Resuming", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.EnabledState", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "The Hyper-V host ##HOST## is reporting that VM ##INSTANCE## is in an operational state of ##VALUE##, which puts this device in a state of ##LEVEL##.\n\nThe Hyper-V operational status codes are as follows:\n\n0=Unknown\n2=Running\n3=Disabled\n0=Unknown\n2=Running\n3=Disabled\n4=Shut Down\n6=Offline\n7=Test\n8=Defe\n9=Quiesce\n10=Reboot\n11=Reset\n32768=Paused\n32769=Suspended\n32770=Starting\n32771=Snapshotting\n32769=Applying Snapshot\n32773=Saving\n32774=Stopping\n32776=Pausing\n32777=Resuming\n\nThis condition began at ##START## -- or ##DURATION## ago."}, {"name": "GuestVisiblePhysicalMemory", "description": "Amount of RAM visible to the virtual machine: how much it thinks it has. Measured in MB.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.GuestVisiblePhysicalMemory", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 3, "alertBody": "The average memory pressure on Hyper-V VM ##INSTANCE## (##DSIDESCRIPTION##) on host ##HOST## is now at ##VALUE##, which puts this device in a ##LEVEL## state.\n\nThis began at ##START## -- or for ##DURATION##.\n\nConsider increasing the memory allocated to this VM or reduce its workload."}, {"name": "MaximumPressure", "description": "Maximum amount of memory pressure on this VM", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.MaximumPressure", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 3}, {"name": "MeanBytesReceivedPerSec", "description": "Network read throughput (bytes/sec)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.MeanBytesReceivedPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MeanBytesSentPerSec", "description": "Network write throughput (bytes/sec)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.MeanBytesSentPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MeanPacketsReceivedPerSec", "description": "Network read throughput (packets/sec)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.MeanPacketsReceivedPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MeanPacketsSentPerSec", "description": "Network write throughput (packets/sec)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.MeanPacketsSentPerSec", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MinimumPressure", "description": "The minimum amount of memory pressure on this VM", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.MinimumPressure", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 3}, {"name": "PercentGuestRunTime", "description": "Percent cpu usage by the guest os for this VM", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.MeanPercentGuestRunTime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "> 90 95", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The Hyper-V host ##HOST## is reporting that VM ##INSTANCE## is has a CPU usage of ##VALUE##, which puts this device in a state of ##LEVEL##. Consider investigating running processes or increasing the number of virtual CPUs.\n\nThis condition began at ##START## -- or ##DURATION## ago."}, {"name": "PercentHypervisorRunTime", "description": "Percent cpu usage by the hypervisor for this VM", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.MeanPercentHypervisorRunTime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PercentTotalRunTime", "description": "Percent cpu usage for this VM", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.MeanPercentTotalRunTime", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PhysicalMemory", "description": "Amount of RAM actually allocated to the virtual machine: how much it actually has. Measured in MB.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.PhysicalMemory", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 3, "alertBody": "The average memory pressure on Hyper-V VM ##INSTANCE## (##DSIDESCRIPTION##) on host ##HOST## is now at ##VALUE##, which puts this device in a ##LEVEL## state.\n\nThis began at ##START## -- or for ##DURATION##.\n\nConsider increasing the memory allocated to this VM or reduce its workload."}, {"name": "ReadBytesPersec", "description": "Boot disk read throughput (bytes/sec)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ReadBytesPersec", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ReadCount", "description": "Boot disk read iops", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.ReadCount", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WriteBytesPersec", "description": "Boot disk write throughput (bytes/sec)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.WriteBytesPersec", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WriteCount", "description": "Boot disk write iops", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.WriteCount", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "operationalStatus", "description": "Status Codes:\n\n0: Ok\n1: Degraded\n2: PredictiveFailure\n3: InService\n4: Dormant\n5: SupportingEntityInError\n6: ApplyingSnapshot\n7: CreatingSnapshot\n8: DeletingSnapshot\n9: WaitingToStart\n10: MergingDisks\n11: ExportingVirtualMachine\n12: MigratingVirtualMachine\n13: BackingUpVirtualMachine\n14: ModifyingUpVirtualMachine\n15: StorageMigrationPhaseOne\n16: StorageMigrationPhaseTwo\n17: MigratingPlannedVm\n18: CheckingCompatibility\n19: ApplicationCriticalState\n20: CommunicationTimedOut\n21: CommunicationFailed\n22: NoIommu\n23: NoIovSupportInNic\n24: SwitchNotInIovMode\n25: IovBlockedByPolicy\n26: IovNoAvailResources\n27: IovGuestDriversNeeded\n28: CriticalIoError", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.operationalStatus", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The Hyper-V host ##HOST## is reporting that VM ##INSTANCE## is in an operational state of ##VALUE##, which puts this device in a state of ##LEVEL##.\n\nThe Hyper-V operational operational status codes are as follows:\n\n0: Ok\n1: Degraded\n2: PredictiveFailure\n3: InService\n4: Dormant\n5: SupportingEntityInError\n6: ApplyingSnapshot\n7: CreatingSnapshot\n8: DeletingSnapshot\n9: WaitingToStart\n10: MergingDisks\n11: ExportingVirtualMachine\n12: MigratingVirtualMachine\n13: BackingUpVirtualMachine\n14: ModifyingUpVirtualMachine\n15: StorageMigrationPhaseOne\n16: StorageMigrationPhaseTwo\n17: MigratingPlannedVm\n18: CheckingCompatibility\n19: ApplicationCriticalState\n20: CommunicationTimedOut\n21: CommunicationFailed\n22: NoIommu\n23: NoIovSupportInNic\n24: SwitchNotInIovMode\n25: IovBlockedByPolicy\n26: IovNoAvailResources\n27: IovGuestDriversNeeded\n28: CriticalIoError\n\nThis condition began at ##START## -- or ##DURATION## ago."}, {"name": "state", "description": "Status Codes:\n\n0: Other\n1: Running\n2: Off\n3: Stopping\n4: Saved\n5: Paused\n6: Starting\n7: Reset\n8: Saving\n9: Pausing\n10: Resuming\n11: FastSaved\n12: FastSaving\n13: RunningCritical\n14: OffCritical\n15: StoppingCritical\n16: SavedCritical\n17: PausedCritical\n18: StartingCritical\n19: ResetCritical\n20: SavingCritical\n21: PausingCritical\n22: ResumingCritical\n23: FastSavedCritical\n24: FastSavingCritical", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.state", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Boot Disk IOPS", "title": "Boot Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ReadSectorsPersec", "datapointName": "ReadCount", "consolidationFn": "average"}, {"name": "WrittenSectorsPersec", "datapointName": "WriteCount", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Reads", "color": "blue", "datapointName": "ReadSectorsPersec", "isVirtual": false}, {"type": "stack", "legend": "Writes", "color": "green", "datapointName": "WrittenSectorsPersec", "isVirtual": false}]}, {"name": "Boot Disk Throughput", "title": "Boot Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ReadBytesPersec", "datapointName": "ReadBytesPersec", "consolidationFn": "average"}, {"name": "WriteBytesPersec", "datapointName": "WriteBytesPersec", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Reads", "color": "orange", "datapointName": "ReadBytesPersec", "isVirtual": false}, {"type": "stack", "legend": "Writes", "color": "purple", "datapointName": "WriteBytesPersec", "isVirtual": false}]}, {"name": "CPU Utilization", "title": "CPU Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "PercentGuestRunTime", "datapointName": "PercentGuestRunTime", "consolidationFn": "average"}, {"name": "PercentHypervisorRunTime", "datapointName": "PercentHypervisorRunTime", "consolidationFn": "average"}, {"name": "PercentTotalRunTime", "datapointName": "PercentTotalRunTime", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Guest OS", "color": "orange", "datapointName": "PercentGuestRunTime", "isVirtual": false}, {"type": "stack", "legend": "Hypervisor", "color": "blue", "datapointName": "PercentHypervisorRunTime", "isVirtual": false}]}, {"name": "Memory Pressure", "title": "Memory Pressure", "verticalLabel": "%", "min": 0.0, "max": 200.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AveragePressure", "datapointName": "AveragePressure", "consolidationFn": "average"}, {"name": "MaximumPressure", "datapointName": "MaximumPressure", "consolidationFn": "max"}, {"name": "MinimumPressure", "datapointName": "MinimumPressure", "consolidationFn": "min"}], "lines": [{"type": "area", "legend": "Average Pressure", "color": "yellow", "datapointName": "AveragePressure", "isVirtual": false}, {"type": "line", "legend": "Maximum Pressure", "color": "lime", "datapointName": "MaximumPressure", "isVirtual": false}, {"type": "line", "legend": "Minimum Pressure", "color": "black", "datapointName": "MinimumPressure", "isVirtual": false}]}, {"name": "Memory Use", "title": "Memory Use", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "GuestVisiblePhysicalMemory", "datapointName": "GuestVisiblePhysicalMemory", "consolidationFn": "average"}, {"name": "PhysicalMemory", "datapointName": "PhysicalMemory", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "GuestVisiblePhysicalMemoryBytes", "expr": "GuestVisiblePhysicalMemory * 1000 * 1000"}, {"name": "PhysicalMemoryBytes", "expr": "PhysicalMemory * 1000 * 1000"}], "lines": [{"type": "line", "legend": "Guest Visible Physical Memory", "color": "aqua", "datapointName": "GuestVisiblePhysicalMemoryBytes", "isVirtual": true}, {"type": "line", "legend": "Physical Memory", "color": "black", "datapointName": "PhysicalMemoryBytes", "isVirtual": true}]}, {"name": "Network Throughput", "title": "Network Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "MeanBytesReceivedPerSec", "datapointName": "MeanBytesReceivedPerSec", "consolidationFn": "average"}, {"name": "MeanBytesSentPerSec", "datapointName": "MeanBytesSentPerSec", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "inbps", "expr": "MeanBytesReceivedPerSec * 8"}, {"name": "outbps", "expr": "MeanBytesSentPerSec * 8"}], "lines": [{"type": "stack", "legend": "Incoming", "color": "teal", "datapointName": "inbps", "isVirtual": true}, {"type": "stack", "legend": "Outgoing", "color": "olive", "datapointName": "outbps", "isVirtual": true}]}, {"name": "Packet Rate", "title": "Packet Rate", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "MeanPacketsReceivedPerSec", "datapointName": "MeanPacketsReceivedPerSec", "consolidationFn": "average"}, {"name": "MeanPacketsSentPerSec", "datapointName": "MeanPacketsSentPerSec", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Incoming", "color": "blue", "datapointName": "MeanPacketsReceivedPerSec", "isVirtual": false}, {"type": "line", "legend": "Outgoing", "color": "green", "datapointName": "MeanPacketsSentPerSec", "isVirtual": false}]}, {"name": "Run Status", "title": "Run Status", "verticalLabel": "status code", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "EnabledState", "datapointName": "EnabledState", "consolidationFn": "max"}, {"name": "operationalStatus", "datapointName": "operationalStatus", "consolidationFn": "max"}, {"name": "state", "datapointName": "state", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Enabled State", "color": "maroon", "datapointName": "EnabledState", "isVirtual": false}, {"type": "line", "legend": "Operational Status", "color": "green", "datapointName": "operationalStatus", "isVirtual": false}, {"type": "line", "legend": "state", "color": "blue", "datapointName": "state", "isVirtual": false}]}], "overviewGraphs": [{"name": "VM Boot Disk Throughput Overview", "title": "VM Boot Disk Throughput Overview", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ReadBytesPersec", "datapointName": "ReadBytesPersec", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "WriteBytesPersec", "datapointName": "WriteBytesPersec", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "Throughput", "expr": "ReadBytesPersec + WriteBytesPersec"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "blue", "datapointName": "Throughput", "isVirtual": true}]}, {"name": "VM CPU Utilization Overview", "title": "VM CPU Utilization Overview", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "PercentGuestRunTime", "datapointName": "PercentGuestRunTime", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "blue", "datapointName": "PercentGuestRunTime", "isVirtual": false}]}, {"name": "VM Memory Pressure Overview", "title": "VM Memory Pressure Overview", "verticalLabel": "%", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "AveragePressure", "datapointName": "AveragePressure", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "area", "legend": "##INSTANCE##", "color": "blue", "datapointName": "AveragePressure", "isVirtual": false}]}, {"name": "VM Network Throughput Overview", "title": "VM Network Throughput Overview", "verticalLabel": "bps", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "MeanBytesReceivedPerSec", "datapointName": "MeanBytesReceivedPerSec", "consolidationFn": "average", "aggregateMethod": "sum"}, {"name": "MeanBytesSentPerSec", "datapointName": "MeanBytesSentPerSec", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "ThroughputBps", "expr": "(MeanBytesSentPerSec + MeanBytesReceivedPerSec) * 8"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "blue", "datapointName": "ThroughputBps", "isVirtual": true}]}, {"name": "VM Visible Memory Overview", "title": "VM Visible Memory Overview", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "GuestVisiblePhysicalMemory", "datapointName": "GuestVisiblePhysicalMemory", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "GuestVisiblePhysicalMemoryBytes", "expr": "GuestVisiblePhysicalMemory * 1000 * 1000"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "blue", "datapointName": "GuestVisiblePhysicalMemoryBytes", "isVirtual": true}]}]}

×DataSource: Oracle_Database_WinServices (915)

{"name": "Oracle_Database_WinServices", "description": "Monitors operating state and status of Oracle services on Windows.", "appliesTo": "isWindows() && hasCategory(\"OracleDB\")", "searchKeywords": "database,oracle,application,services,windows,sql", "technicalNotes": "For additional configuration information go to: https://www.logicmonitor.com/support/monitoring/applications-databases/oracle", "displayedAs": "Oracle Services", "collectionInterval": "3m", "collectionMethod": "wmi", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_wmi", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"namespace": "CIMV2", "class": "Win32_Service", "property": "displayname"}, "filters": [{"attr": "displayname", "op": "Contain", "value": "Oracle", "comment": "Only discover Oracle services"}, {"attr": "state", "op": "Contain", "value": "Running", "comment": "During Active Discovery, only discover running services"}], "groupMethod": "none"}, "collectionAttrs": {"namespace": "CIMV2", "collectionType": "query", "class": "Win32_Service", "indexProperty": "displayname", "indexValue": "##WILDVALUE##"}, "datapoints": [{"name": "RunningStatus", "description": "If service is running, alert if Status is not OK.", "config": {"wmiClassAttr": "RunningStatus"}, "interpretMethod": "expression", "interpretExpr": "if(eq(State,1),Status,1)", "type": "gauge", "dataType": 1, "threshold": "!= 1", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "Windows Oracle Service ##INSTANCE## on ##HOST## is running but is not in an optimal operating state, placing it into ##LEVEL## state.\n\nIt may be in error, degraded or starting/stopping state. ##VALUE## is the current reading and represents an error state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "State", "description": "Current operating state of the Oracle Server service.\n\n1=running", "config": {"wmiClassAttr": "State"}, "interpretMethod": "textmatch", "interpretExpr": "Running", "type": "gauge", "dataType": 1, "min": "0", "threshold": "!= 1", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "Windows Oracle Service ##INSTANCE## on ##HOST## is not running, placing it into ##LEVEL## state. ##VALUE## is the current reading and represents an error state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "Status", "description": "Operating status of the Oracle Service.\n\n1=OK", "config": {"wmiClassAttr": "Status"}, "interpretMethod": "textmatch", "interpretExpr": "OK", "type": "gauge", "dataType": 1, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0}], "graphs": [{"name": "State", "title": "State", "verticalLabel": "status code", "min": 0.0, "max": 2.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "State", "datapointName": "State", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "State 1 = Running", "color": "blue", "datapointName": "State", "isVirtual": false}]}, {"name": "Status", "title": "Status", "verticalLabel": "status code", "min": 0.0, "max": 2.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status 1 = OK", "color": "blue", "datapointName": "Status", "isVirtual": false}]}]}

×DataSource: Linux_SSH_ServiceStatus (590)

{"name": "Linux_SSH_ServiceStatus", "description": "Linux systemd services via SSH using the systemctl list-units command.", "appliesTo": "/* Set by PropertySource */\nhasCategory(\"Linux_SSH\")", "searchKeywords": "service,linux,ssh", "technicalNotes": "Refer to the support article below for instructions on adding monitored instances directly on the resource. To monitor all services, enable AD and add the script provided in the support article.\n\n- Support: https://www.logicmonitor.com/support/monitoring/os-virtualization/linux-via-ssh-monitoring", "displayedAs": "Service Status", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": false, "discoveryMethod": "", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.jcraft.jsch.JSch\nimport com.santaba.agent.util.Settings\n\nhost = hostProps.get(\"system.hostname\")\nuser = hostProps.get(\"ssh.user\")\npass = hostProps.get(\"ssh.pass\")\nport = hostProps.get(\"ssh.port\")?.toInteger() ?: 22\ncert = hostProps.get(\"ssh.cert\") ?: '~/.ssh/id_rsa'\ntimeout = 15000 // timeout in milliseconds\n\ndef azureHost = hostProps.get(\"system.azure.privateIpAddress\")\nif (azureHost && hostProps.get(\"auto.network.resolves\") == \"false\") host = azureHost\n\n// Expected pattern of output lines with data\ndef line_pattern = ~/^\\/?\\s*(\\S+)\\s+(\\w*loaded|not-found|masked\\w*)\\s+(\\w*active|inactive|failed\\w*)\\s+(\\S+)\\s+(.*)$/\n\n// Run command to show any unit that systemd loaded or attempted to load, regardless of its current state on the system.\ndef command = 'systemctl list-units --all --type=service --plain'\ndef command_output = getCommandOutput(command)\n\n// Establish load, active, and sub values for unloaded services not listed\ndef load = 4\ndef active = 4\ndef sub = 4\n\ncommand_output.eachLine { line ->\n def matcher = line_pattern.matcher(line) ?: [:]\n // Process lines that contain a match\n if (matcher.size() > 0) {\n def wildvalue = matcher[0][1]\n load = matcher[0][2]\n active = matcher[0][3]\n sub = matcher[0][4]\n\n // Modify load responses to integer values\n if (load.contains(\"loaded\")) {\n load = 0\n }\n else if (load.contains(\"masked\")) {\n load = 1\n }\n else if (load.contains(\"not-found\")) {\n load = 2\n }\n \n // Modify active responses to integer values\n if (active.contains(\"active\")) {\n active = 0\n }\n else if (active.contains(\"inactive\")) {\n active = 1\n }\n else if (active.contains(\"failed\")) {\n active = 2\n }\n\n // Modify sub responses to integer values\n if (sub.contains(\"running\")) {\n sub = 0\n }\n else if (sub.contains(\"exited\")) {\n sub = 1\n }\n else if (sub.contains(\"failed\")) {\n sub = 2\n }\n else if (sub.contains(\"dead\")) {\n sub = 3\n }\n\n println \"${wildvalue}.load=${load}\"\n println \"${wildvalue}.active=${active}\"\n println \"${wildvalue}.sub=${sub}\"\n }\n}\nreturn 0\n\n\n// Helper function for SSH connection and command passing\ndef getCommandOutput(String input_command) {\n try {\n // instantiate JSCH object.\n jsch = new JSch()\n\n // do we have an user and no pass ?\n if (user && !pass) {\n // Yes, so lets try connecting via cert.\n jsch.addIdentity(cert)\n }\n\n // create session.\n session = jsch.getSession(user, host, port)\n\n // given we are running non-interactively, we will automatically accept new host keys.\n session.setConfig(\"StrictHostKeyChecking\", \"no\");\n String authMethod = Settings.getSetting(Settings.SSH_PREFEREDAUTHENTICATION, Settings.DEFAULT_SSH_PREFEREDAUTHENTICATION);\n session.setConfig(\"PreferredAuthentications\", authMethod);\n\n // set session timeout, in milliseconds.\n session.setTimeout(timeout)\n\n // is host configured with a user & password?\n if (pass) {\n // set password.\n session.setPassword(pass);\n }\n\n // connect\n session.connect()\n\n // execute command.\n channel = session.openChannel(\"exec\")\n channel.setCommand(input_command)\n\n // collect command output.\n def commandOutput = channel.getInputStream()\n channel.connect()\n\n def output = commandOutput.text;\n\n // disconnect\n channel.disconnect()\n\n return output\n }\n // ensure we disconnect the session.\n finally {\n session.disconnect()\n }\n}"}, "datapoints": [{"name": "ActivationState", "description": "The high-level unit activation state.\n\nStatus codes:\n0=active, \n1=exited, \n2=failed, \n4=not loaded", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.active", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "= 2", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "Service ##INSTANCE## on ##HOST## is reporting activation state of ##VALUE## indicating this service has failed, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "LoadState", "description": "Reflects whether the unit is loaded. \n\nStatus codes: \n0=loaded, \n1=masked, \n2=not found, \n4=not listed", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.load", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": ">= 2", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "Service ##INSTANCE## on ##HOST## is reporting load state of ##VALUE##, placing the host into ##LEVEL## state.\n\n##DPDESCRIPTION##\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "SubState", "description": "The low-level unit activation state.\n\nStatus codes:\n0=running, \n1=exited, \n2=failed, \n3=dead, \n4=not loaded", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sub", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Activation State", "title": "Activation State", "verticalLabel": "status code", "min": -1.0, "max": 5.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ActivationState", "datapointName": "ActivationState", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "0=active, 1=inactive, 2=failed, 4=not loaded", "color": "silver", "datapointName": "ActivationState", "isVirtual": false}]}, {"name": "Load State", "title": "Load State", "verticalLabel": "status code", "min": -1.0, "max": 2.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "LoadState", "datapointName": "LoadState", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "0=loaded, 1=not loaded", "color": "silver", "datapointName": "LoadState", "isVirtual": false}]}, {"name": "Sub State", "title": "Sub State", "verticalLabel": "status code", "min": -1.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SubState", "datapointName": "SubState", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "0=running, 1=exited, 2=failed, 3=dead, 4=not loaded", "color": "silver", "datapointName": "SubState", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Services by Activation State", "title": "Top 10 Services by Activation State", "verticalLabel": "status code", "min": -1.0, "max": 5.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ActivationState", "datapointName": "ActivationState", "consolidationFn": "average", "aggregateMethod": "average"}], "lines": [{"type": "line", "legend": "##INSTANCE## 0=active, 1=inactive, 2=failed, 4=not loaded", "color": "silver", "datapointName": "ActivationState", "isVirtual": false}]}, {"name": "Top 10 Services by Load State", "title": "Top 10 Services by Load State", "verticalLabel": "status code", "min": -1.0, "max": 5.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "LoadState", "datapointName": "LoadState", "consolidationFn": "average", "aggregateMethod": "average"}], "lines": [{"type": "line", "legend": "##INSTANCE## 0=loaded, 1=masked, 2=not found, 4=not listednot loaded", "color": "silver", "datapointName": "LoadState", "isVirtual": false}]}, {"name": "Top 10 Services by Sub State", "title": "Top 10 Services by Sub State", "verticalLabel": "status code", "min": -1.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "SubState", "datapointName": "SubState", "consolidationFn": "average", "aggregateMethod": "average"}], "lines": [{"type": "line", "legend": "##INSTANCE## 0=running, 1=exited, 2=failed, 3=dead, 4=not loaded", "color": "silver", "datapointName": "SubState", "isVirtual": false}]}]}

×DataSource: Microsoft_Azure_ApplicationGateway_v1 (1022)

{"name": "Microsoft_Azure_ApplicationGateway_v1", "description": "Monitors Azure Application Gateways metrics for v1 SKUs.", "appliesTo": "hasCategory(\"Azure/ApplicationGateway\") && (system.azure.sku == \"WAF\" || system.azure.sku == \"Standard\")", "searchKeywords": "cloud,application gateway,azure", "displayedAs": "Azure Application Gateway", "collectionInterval": "1m", "collectionMethod": "azureinsights", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "CurrentConnections", "description": "Count of current connections established with the Application Gateway", "interpretMethod": "json", "interpretExpr": "CurrentConnections.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "FailedRequests", "description": "Count of failed requests that Application Gateway has served.", "interpretMethod": "json", "interpretExpr": "FailedRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0 0", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 0, "alertBody": "The Azure Application Gatway ##HOST## is reporting a sustained rate of failed requests, ##VALUE## requests failed during the last polling interval, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "HealthyHostCount", "description": "Number of unhealthy backend hosts.", "interpretMethod": "json", "interpretExpr": "HealthyHostCount.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Throughput", "description": "Number of bytes per second the Application Gateway has served", "interpretMethod": "json", "interpretExpr": "Throughput.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalRequests", "description": "Count of successful requests that Application Gateway has served.", "interpretMethod": "json", "interpretExpr": "TotalRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UnhealthyHostCount", "description": "Number of unhealthy backend hosts.", "interpretMethod": "json", "interpretExpr": "UnhealthyHostCount.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The Azure Application Gatway ##HOST## is reporting ##VALUE## unhealthy backed hosts, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Backend Hosts", "title": "Backend Hosts", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Healthy", "datapointName": "HealthyHostCount", "consolidationFn": "average"}, {"name": "Unhealthy", "datapointName": "UnhealthyHostCount", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Total", "expr": "Healthy+Unhealthy"}], "lines": [{"type": "stack", "legend": "Healthy", "color": "olive", "datapointName": "Healthy", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "gray", "datapointName": "Total", "isVirtual": true}, {"type": "stack", "legend": "Unhealthy", "color": "red", "datapointName": "Unhealthy", "isVirtual": false}]}, {"name": "Current Connections", "title": "Current Connections", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Connections", "datapointName": "CurrentConnections", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Connections", "color": "fuchsia", "datapointName": "Connections", "isVirtual": false}]}, {"name": "Requests", "title": "Requests", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Failed", "datapointName": "FailedRequests", "consolidationFn": "average"}, {"name": "Total", "datapointName": "TotalRequests", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Failed", "color": "orange", "datapointName": "Failed", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "purple", "datapointName": "Total", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "throughput", "datapointName": "Throughput", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Throughput", "color": "navy", "datapointName": "throughput", "isVirtual": false}]}]}

×DataSource: Microsoft_Azure_ApplicationGateway_v2 (802)

{"name": "Microsoft_Azure_ApplicationGateway_v2", "description": "Monitors Azure Application Gateways metrics for v2 SKUs.", "appliesTo": "hasCategory(\"Azure/ApplicationGateway\") && (system.azure.sku == \"WAF_v2\" || system.azure.sku == \"Standard_v2\")", "searchKeywords": "cloud,application gateway,azure", "displayedAs": "Azure Application Gateway", "collectionInterval": "1m", "collectionMethod": "azureinsights", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "AverageRequestCountPerHealthyHost", "description": "Average request count per minute per healthy backend host in a pool", "interpretMethod": "json", "interpretExpr": "AvgRequestCountPerHealthyHost.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BackendConnectTime", "description": "Time spent establishing a connection with a backend server. Measured in milliseconds.", "interpretMethod": "json", "interpretExpr": "BackendConnectTime.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BackendFirstByteResponseTime", "description": "Time interval between start of establishing a connection to backend server and receiving the first byte of the response header, approximating processing time of backend server. Measured in milliseconds.", "interpretMethod": "json", "interpretExpr": "BackendFirstByteResponseTime.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BackendLastByteResponseTime", "description": "Time interval between start of establishing a connection to backend server and receiving the last byte of the response body. Measured in milliseconds.", "interpretMethod": "json", "interpretExpr": "BackendLastByteResponseTime.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BackendResponseStatus", "description": "The number of HTTP response codes generated by the backend members. This does not include any response codes generated by the Application Gateway.", "interpretMethod": "json", "interpretExpr": "BackendResponseStatus.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesReceived", "description": "The total number of bytes received by the Application Gateway from the clients", "interpretMethod": "json", "interpretExpr": "BytesReceived.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BytesSent", "description": "The total number of bytes sent by the Application Gateway to the clients", "interpretMethod": "json", "interpretExpr": "BytesSent.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CapacityUnits", "description": "Capacity Units consumed", "interpretMethod": "json", "interpretExpr": "CapacityUnits.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ClientRTT", "description": "Average round trip time between clients and Application Gateway. This metric indicates how long it takes to establish connections and return acknowledgements. Measured in milliseconds.", "interpretMethod": "json", "interpretExpr": "ClientRtt.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ComputeUnits", "description": "Compute Units consumed", "interpretMethod": "json", "interpretExpr": "ComputeUnits.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CurrentConnections", "description": "Count of current connections established with Application Gateway", "interpretMethod": "json", "interpretExpr": "CurrentConnections.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "EstimatedBilledCapacityUnits", "description": "Estimated capacity units that will be charged", "interpretMethod": "json", "interpretExpr": "EstimatedBilledCapacityUnits.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "FailedRequests", "description": "Count of failed requests that Application Gateway has served.", "interpretMethod": "json", "interpretExpr": "FailedRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0 0", "noData": "Do not trigger an alert", "triggerInterval": 10, "clearInterval": 0, "alertBody": "The Azure Application Gatway ##HOST## is reporting a sustained rate of failed requests, ##VALUE## requests failed during the last polling interval, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "FixedBillableCapacityUnits", "description": "Minimum capacity units that will be charged", "interpretMethod": "json", "interpretExpr": "FixedBillableCapacityUnits.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "HealthyHostCount", "description": "Number of healthy backend hosts.", "interpretMethod": "json", "interpretExpr": "HealthyHostCount.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NewConnectionsPerSecond", "description": "New connections per second established with Application Gateway", "interpretMethod": "json", "interpretExpr": "NewConnectionsPerSecond.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RequestAverageProcessingTime", "description": "Average time that it takes for a request to be processed and its response to be sent. Measured in milliseconds.\n\nCalculated as average of the interval from the time when Application Gateway receives the first byte of an HTTP request to the time when the response send operation finishes. It's important to note that this usually includes the Application Gateway processing time, time that the request and response packets are traveling over the network and the time the backend server took to respond.", "interpretMethod": "json", "interpretExpr": "ApplicationGatewayTotalTime.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ResponseStatus", "description": "HTTP response status returned by Application Gateway", "interpretMethod": "json", "interpretExpr": "ResponseStatus.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TLSRequests", "description": "The number of TLS and non-TLS requests initiated by the client that established connection with the Application Gateway.", "interpretMethod": "json", "interpretExpr": "TlsProtocol.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Throughput", "description": "Number of bytes per second the Application Gateway has served", "interpretMethod": "json", "interpretExpr": "Throughput.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalRequests", "description": "Count of successful requests that Application Gateway has served", "interpretMethod": "json", "interpretExpr": "TotalRequests.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UnhealthyHostCount", "description": "Number of unhealthy backend hosts", "interpretMethod": "json", "interpretExpr": "UnhealthyHostCount.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The Azure Application Gatway ##HOST## is reporting ##VALUE## unhealthy backed hosts, placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Average Request Processing Time", "title": "Average Request Processing Time", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ProcessingTime", "datapointName": "RequestAverageProcessingTime", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Processing Time", "color": "red1", "datapointName": "ProcessingTime", "isVirtual": false}]}, {"name": "Average Round Trip Time", "title": "Average Round Trip Time", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "RTT", "datapointName": "ClientRTT", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "RTT", "color": "orange", "datapointName": "RTT", "isVirtual": false}]}, {"name": "Backend Connection Time", "title": "Backend Connection Time", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 12, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ConnectionTime", "datapointName": "BackendConnectTime", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Connection Time", "color": "purple", "datapointName": "ConnectionTime", "isVirtual": false}]}, {"name": "Backend Hosts", "title": "Backend Hosts", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Healthy", "datapointName": "HealthyHostCount", "consolidationFn": "average"}, {"name": "Unhealthy", "datapointName": "UnhealthyHostCount", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Total", "expr": "Unhealthy+Healthy"}], "lines": [{"type": "stack", "legend": "Healthy", "color": "olive", "datapointName": "Healthy", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "Total", "isVirtual": true}, {"type": "stack", "legend": "Unhealthy", "color": "orange", "datapointName": "Unhealthy", "isVirtual": false}]}, {"name": "Backend Response Time", "title": "Backend Response Time", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 13, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "FirstByte", "datapointName": "BackendFirstByteResponseTime", "consolidationFn": "average"}, {"name": "LastByte", "datapointName": "BackendLastByteResponseTime", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "First Byte", "color": "blue", "datapointName": "FirstByte", "isVirtual": false}, {"type": "line", "legend": "Last Byte", "color": "olive", "datapointName": "LastByte", "isVirtual": false}]}, {"name": "Capacity Units Consumed", "title": "Capacity Units Consumed", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "EstimatedBilled", "datapointName": "EstimatedBilledCapacityUnits", "consolidationFn": "average"}, {"name": "FixedBillable", "datapointName": "FixedBillableCapacityUnits", "consolidationFn": "average"}, {"name": "Total", "datapointName": "CapacityUnits", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Estimated Billed", "color": "orange2", "datapointName": "EstimatedBilled", "isVirtual": false}, {"type": "line", "legend": "Fixed Billable", "color": "red1", "datapointName": "FixedBillable", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "Total", "isVirtual": false}]}, {"name": "Compute Units Consumed", "title": "Compute Units Consumed", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Units", "datapointName": "ComputeUnits", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Units", "color": "fuchsia", "datapointName": "Units", "isVirtual": false}]}, {"name": "Current Connections", "title": "Current Connections", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Connections", "datapointName": "CurrentConnections", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Connections", "color": "lime", "datapointName": "Connections", "isVirtual": false}]}, {"name": "Data Transferred", "title": "Data Transferred", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "Received", "datapointName": "BytesReceived", "consolidationFn": "average"}, {"name": "Sent", "datapointName": "BytesSent", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Received", "color": "olive", "datapointName": "Received", "isVirtual": false}, {"type": "line", "legend": "Sent", "color": "aqua", "datapointName": "Sent", "isVirtual": false}]}, {"name": "HTTP Response Status", "title": "HTTP Response Status", "verticalLabel": "status code", "min": 0.0, "displayPriority": 15, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "ResponseStatus", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "fuchsia", "datapointName": "Status", "isVirtual": false}]}, {"name": "New Connections", "title": "New Connections", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Connections", "datapointName": "NewConnectionsPerSecond", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Connections", "color": "green", "datapointName": "Connections", "isVirtual": false}]}, {"name": "Requests", "title": "Requests", "verticalLabel": "count", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Failed", "datapointName": "FailedRequests", "consolidationFn": "average"}, {"name": "Total", "datapointName": "TotalRequests", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Successful", "expr": "Total-Failed"}], "lines": [{"type": "stack", "legend": "Failed", "color": "red", "datapointName": "Failed", "isVirtual": false}, {"type": "stack", "legend": "Successful", "color": "olive", "datapointName": "Successful", "isVirtual": true}, {"type": "line", "legend": "Total", "color": "gray", "datapointName": "Total", "isVirtual": false}]}, {"name": "Requests Per Healthy Host", "title": "Requests Per Healthy Host", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "RequestsPerMinute", "datapointName": "AverageRequestCountPerHealthyHost", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "RequestsPerSecond", "expr": "RequestsPerMinute/60"}], "lines": [{"type": "area", "legend": "Requests", "color": "blue", "datapointName": "RequestsPerSecond", "isVirtual": true}]}, {"name": "Response Codes Generated", "title": "Response Codes Generated", "verticalLabel": "count", "min": 0.0, "displayPriority": 14, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ResponseCodes", "datapointName": "BackendResponseStatus", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Response Codes", "color": "yellow", "datapointName": "ResponseCodes", "isVirtual": false}]}, {"name": "TLS Requests", "title": "TLS Requests", "verticalLabel": "count", "min": 0.0, "displayPriority": 16, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Requests", "datapointName": "TLSRequests", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Requests", "color": "orange", "datapointName": "Requests", "isVirtual": false}]}, {"name": "Throughput", "title": "Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "Throughput", "datapointName": "Throughput", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Throughput", "color": "blue", "datapointName": "Throughput", "isVirtual": false}]}]}

×DataSource: LogicMonitor_Portal_APIUtilization (863)

{"name": "LogicMonitor_Portal_APIUtilization", "description": "Monitor utilization of API endpoints on a LogicMonitor account.", "appliesTo": "hasCategory(\"LogicMonitorPortal\") && system.displayname =~ \".logicmonitor.com\"", "searchKeywords": "logicmonitor,sas,api", "technicalNotes": "This module requires the \"addCategory_LogicMonitorPortal\" PropertySource to be installed, a device with a hostname and displayname including \"logicmonitor.com\", and the following properties configured:\n\nlmaccess.id - API Token ID\nlmaccess.key - API Token key\nlmaccount - (optional) Name of your LM account. This will default to whatever account this is running on.", "displayedAs": "LogicMonitor API Utilization", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.live.LiveHostSet\nimport org.apache.commons.codec.binary.Hex\nimport javax.crypto.Mac\nimport javax.crypto.spec.SecretKeySpec\nimport java.security.MessageDigest\n\n\nString apiId = hostProps.get(\"lmaccess.id\")?:hostProps.get(\"logicmonitor.access.id\")\nString apiKey = hostProps.get(\"lmaccess.key\")?:hostProps.get(\"logicmonitor.access.key\")\ndef portalName = hostProps.get(\"lmaccount\")?:Settings.getSetting(Settings.AGENT_COMPANY)\ndef collectorProxy = Settings.getSetting(\"proxy.enable\").toBoolean()\nMap proxyInfo = [:]\n\nif (collectorProxy) {\n proxyInfo = [\n enabled : true,\n host : Settings.getSetting(\"proxy.host\"),\n port : Settings.getSetting(\"proxy.port\"),\n user : Settings.getSetting(\"proxy.user\"),\n pass : Settings.getSetting(\"proxy.pass\")\n ]\n\n proxyInfo[\"proxy\"] = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo.host, proxyInfo.port.toInteger()))\n}\n\ndef endPoints = apiGetManyV2(portalName, apiId, apiKey, \"/apiStats/externalApis\", proxyInfo, [:])\n\n// Container for cleaned data\ndef seenEndpoints = [:]\n\n// Separate endPoints based on ending\ndef endPointsClean = endPoints.findAll { !it['api'].endsWith('/') }\ndef endPointsDirty = endPoints.findAll { it['api'].endsWith('/') }\n\n// Process endpoints without / first\n// These endpoints contain metadata we want to use for AD\nendPointsClean.each { endPoint ->\n String wildalias = endPoint['api']\n\n def wildvalue = MessageDigest.getInstance(\"MD5\").digest(endPoint.get('api', \"\").bytes).encodeHex()\n def category = \"Uncategorized\"\n if (endPoint['tags']) {\n category = endPoint['tags'][0]\n }\n\n def description = endPoint.get('summary', '')\n \n if (description == null) {\n description = \"\"\n }\n\n def adLine = \"${wildvalue}##${wildalias}##${description}####auto.api.category=${category}\"\n\n if (!seenEndpoints.containsKey(wildalias)) {\n seenEndpoints[wildalias] = adLine\n return\n }\n}\n\n// Process endpoints with / last\n// These endpoints are missing metadata in the response used for instance descriptions and grouping\nendPointsDirty.each{ endPoint->\n String wildalias = endPoint['api']\n\n def wildvalue = MessageDigest.getInstance(\"MD5\").digest(endPoint.get('api', \"\").bytes).encodeHex()\n def category = \"Uncategorized\"\n if(endPoint['tags']) {\n category = endPoint['tags'][0]\n }\n\n def description = endPoint.get('summary', '')\n \n if (description == null) {\n description = \"\"\n }\n\n if (wildalias.endsWith(\"/\")) {\n wildalias = wildalias.substring(0, wildalias.length()-1)\n }\n\n def adLine = \"${wildvalue}##${wildalias}##${description}####auto.api.category=${category}\"\n\n // Handle server breakage where calls with trailing slashes are accounted for as separate endpoints\n if (!seenEndpoints.containsKey(wildalias)) {\n seenEndpoints[wildalias] = adLine\n return\n }\n}\n\n// Output consolidate results.\nseenEndpoints.each { wildalias, adLine ->\n println adLine\n}\n\n// If script gets to this point, collector should consider this device alive\nkeepAlive(hostProps)\n\nreturn 0\n\n\n/* Paginated GET method. Returns a list of objects. */\nList apiGetManyV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n\n def pageSize = args.get('size', 1000) // Default the page size to 1000 if not specified.\n List items = []\n\n args['size'] = pageSize\n\n def pageCount = 0\n while (true) {\n pageCount += 1\n\n // Updated the args\n args['size'] = pageSize\n args['offset'] = items.size()\n\n def response = apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (response.get(\"errmsg\", \"OK\") != \"OK\") {\n throw new Exception(\"Santaba returned errormsg: ${payload?.errmsg}\")\n }\n items.addAll(response.items)\n\n // If we recieved less than we asked for it means we are done\n if (response.items.size() < pageSize) break\n }\n return items\n}\n\n\n/* Simple GET, returns a parsed json payload. No processing. */\ndef apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def request = rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (request.getResponseCode() == 200) {\n def payload = new JsonSlurper().parseText(request.content.text)\n return payload\n }\n else {\n throw new Exception(\"Server return HTTP code ${request.getResponseCode()}\")\n }\n}\n\n\n/* Raw GET method. */\ndef rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def auth = generateAuth(apiId, apiKey, endPoint)\n def headers = [\"Authorization\": auth, \"Content-Type\": \"application/json\", \"X-Version\":\"2\", \"External-User\":\"true\"]\n def url = \"https://${portalName}.logicmonitor.com/santaba/rest${endPoint}\"\n\n if (args) {\n def encodedArgs = []\n args.each{ k,v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n\n def request\n if (proxyInfo.enabled) {\n request = url.toURL().openConnection(proxyInfo.proxy)\n }\n else {\n request = url.toURL().openConnection()\n }\n request.setRequestMethod(\"GET\")\n request.setDoOutput(true)\n headers.each{ k,v ->\n request.addRequestProperty(k, v)\n }\n\n return request\n}\n\n\n/* Generate auth for API calls. */\nstatic String generateAuth(id, key, path) {\n Long epoch_time = System.currentTimeMillis()\n Mac hmac = Mac.getInstance(\"HmacSHA256\")\n hmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA256\"))\n def signature = Hex.encodeHexString(hmac.doFinal(\"GET${epoch_time}${path}\".getBytes())).bytes.encodeBase64()\n\n return \"LMv1 ${id}:${signature}:${epoch_time}\"\n}\n\n\n/* Helper method to remind the collector this device is not dead */\ndef keepAlive(hostProps) {\n // Update the liveHost set so tell the collector we are happy.\n hostId = hostProps.get(\"system.deviceId\").toInteger()\n def liveHostSet = LiveHostSet.getInstance()\n liveHostSet.flag(hostId)\n}"}, "groupMethod": "ilp", "groupExpr": "auto.api.category"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.live.LiveHostSet\nimport org.apache.commons.codec.binary.Hex\nimport javax.crypto.Mac\nimport javax.crypto.spec.SecretKeySpec\nimport java.security.MessageDigest\n\n\nString apiId = hostProps.get(\"lmaccess.id\")?:hostProps.get(\"logicmonitor.access.id\")\nString apiKey = hostProps.get(\"lmaccess.key\")?:hostProps.get(\"logicmonitor.access.key\")\ndef portalName = hostProps.get(\"lmaccount\")?:Settings.getSetting(Settings.AGENT_COMPANY)\ndef collectorProxy = Settings.getSetting(\"proxy.enable\").toBoolean()\nMap proxyInfo = [:]\n\nif (collectorProxy) {\n proxyInfo = [\n enabled : true,\n host : Settings.getSetting(\"proxy.host\"),\n port : Settings.getSetting(\"proxy.port\"),\n user : Settings.getSetting(\"proxy.user\"),\n pass : Settings.getSetting(\"proxy.pass\")\n ]\n\n proxyInfo[\"proxy\"] = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo.host, proxyInfo.port.toInteger()))\n}\n\ndef endPoints = apiGetManyV2(portalName, apiId, apiKey, \"/apiStats/externalApis\", proxyInfo, ['size':1000])\n\ndef dedupTable = [:]\n\nendPoints.each { endPoint->\n String endPointPath = endPoint.api\n\n if (endPointPath.endsWith(\"/\")) {\n endPointPath = endPointPath.substring(0, endPointPath.length() - 1)\n }\n\n def dedupBucket = dedupTable.get(endPointPath, [])\n dedupBucket << endPoint\n dedupTable[endPointPath] = dedupBucket\n}\n\ndedupTable.each{endPointPath, dedupBucket->\n def wildvalue = MessageDigest.getInstance(\"MD5\").digest(endPointPath.bytes).encodeHex()\n\n println \"${wildvalue}.maxNanoTime=${ dedupBucket.collect{ it.maxNanoTime}.sum() }\"\n println \"${wildvalue}.maxSecondsTime=${ dedupBucket.collect{ it.maxNanoTime }.sum() / 1e9}\"\n println \"${wildvalue}.totNanoTime=${ dedupBucket.collect { it.totNanoTime}.sum() }\"\n println \"${wildvalue}.totSecondsTime=${ dedupBucket.collect {it.totNanoTime}.sum() / 1e9}\"\n println \"${wildvalue}.totalRequests=${ dedupBucket.collect {it.totalRequests}.sum() }\"\n println \"${wildvalue}.totalProcessedRequests=${dedupBucket.collect {it.totalProcessedRequests}.sum()}\"\n println \"${wildvalue}.totalWaitingRequests=${ dedupBucket.collect {it.totalWaitingRequests}.sum()}\"\n\n}\n\n// If script gets to this point, collector should consider this device alive\nkeepAlive(hostProps)\n\nreturn 0\n\n\n/* Paginated GET method. Returns a list of objects. */\nList apiGetManyV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n\n def pageSize = args.get('size', 1000) // Default the page size to 1000 if not specified.\n List items = []\n\n args['size'] = pageSize\n\n def pageCount = 0\n while (true) {\n pageCount += 1\n\n // Updated the args\n args['size'] = pageSize\n args['offset'] = items.size()\n\n def response = apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (response.get(\"errmsg\", \"OK\") != \"OK\") {\n throw new Exception(\"Santaba returned errormsg: ${payload?.errmsg}\")\n }\n items.addAll(response.items)\n\n // If we recieved less than we asked for it means we are done\n if (response.items.size() < pageSize) break\n }\n return items\n}\n\n\n/* Simple GET, returns a parsed json payload. No processing. */\ndef apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def request = rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (request.getResponseCode() == 200) {\n def payload = new JsonSlurper().parseText(request.content.text)\n return payload\n }\n else {\n throw new Exception(\"Server return HTTP code ${request.getResponseCode()}\")\n }\n}\n\n\n/* Raw GET method. */\ndef rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def auth = generateAuth(apiId, apiKey, endPoint)\n def headers = [\"Authorization\": auth, \"Content-Type\": \"application/json\", \"X-Version\":\"2\", \"External-User\":\"true\"]\n def url = \"https://${portalName}.logicmonitor.com/santaba/rest${endPoint}\"\n\n if (args) {\n def encodedArgs = []\n args.each{ k,v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n\n def request\n if (proxyInfo.enabled) {\n request = url.toURL().openConnection(proxyInfo.proxy)\n }\n else {\n request = url.toURL().openConnection()\n }\n request.setRequestMethod(\"GET\")\n request.setDoOutput(true)\n headers.each{ k,v ->\n request.addRequestProperty(k, v)\n }\n\n return request\n}\n\n\n/* Generate auth for API calls. */\nstatic String generateAuth(id, key, path) {\n Long epoch_time = System.currentTimeMillis()\n Mac hmac = Mac.getInstance(\"HmacSHA256\")\n hmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA256\"))\n def signature = Hex.encodeHexString(hmac.doFinal(\"GET${epoch_time}${path}\".getBytes())).bytes.encodeBase64()\n\n return \"LMv1 ${id}:${signature}:${epoch_time}\"\n}\n\n\n/* Helper method to remind the collector this device is not dead */\ndef keepAlive(hostProps) {\n // Update the liveHost set so tell the collector we are happy.\n hostId = hostProps.get(\"system.deviceId\").toInteger()\n def liveHostSet = LiveHostSet.getInstance()\n liveHostSet.flag(hostId)\n}"}, "datapoints": [{"name": "MaxNanoTime", "description": "Maximum time taken by an API endpoint to process in nanoseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.maxNanoTime", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MaxSecondsTime", "description": "Maximum time taken by an API endpoint to process in seconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.maxSecondsTime", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalNanoTime", "description": "Time spent processing requests for this endpoint in nanoseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totNanoTime", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalProcessedRequests", "description": "Total requests processed per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totalProcessedRequests", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalRequests", "description": "Total requests made per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totalRequests", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalSecondsTime", "description": "Time spent processing requests for this endpoint in seconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totSecondsTime", "useValue": "output", "type": "derive", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalWaitingRequests", "description": "Total count of API requests waiting to be processed for this endpoint.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totalWaitingRequests", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Requests Queued", "title": "Requests Queued", "verticalLabel": "count", "min": 0.0, "displayPriority": 15, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "totalWaitingRequests", "datapointName": "TotalWaitingRequests", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Requests waiting to process", "color": "orange", "datapointName": "totalWaitingRequests", "isVirtual": false}]}, {"name": "Time Consumed", "title": "Time Consumed", "verticalLabel": "nanoseconds", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "maxNanoTime", "datapointName": "MaxNanoTime", "consolidationFn": "average"}, {"name": "totNanoTime", "datapointName": "TotalNanoTime", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Max time taken ", "color": "red", "datapointName": "maxNanoTime", "isVirtual": false}, {"type": "line", "legend": "Total time to process", "color": "aqua", "datapointName": "totNanoTime", "isVirtual": false}]}, {"name": "Total Requests", "title": "Total Requests", "verticalLabel": "requests/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "totalProcessedRequests", "datapointName": "TotalProcessedRequests", "consolidationFn": "average"}, {"name": "totalRequests", "datapointName": "TotalRequests", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Requests processed", "color": "olive", "datapointName": "totalProcessedRequests", "isVirtual": false}, {"type": "line", "legend": "Requests made", "color": "navy", "datapointName": "totalRequests", "isVirtual": false}]}], "overviewGraphs": [{"name": "Longest Running Requests by Time Consumed", "title": "Longest Running Requests by Time Consumed", "verticalLabel": "nanoseconds", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "totNanoTime", "datapointName": "TotalNanoTime", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "totNanoTime", "isVirtual": false}]}, {"name": "Top Endpoints by Processed Requests", "title": "Top Endpoints by Processed Requests", "verticalLabel": "requests/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "processedRequestsPerSec", "datapointName": "TotalProcessedRequests", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "processedRequestsPerSec", "isVirtual": false}]}]}

×DataSource: Cisco_Meraki_UplinkApplianceStatus (23)

{"name": "Cisco_Meraki_UplinkApplianceStatus", "description": "Lists the uplink status of every Meraki MX and Z series appliances in the organization.", "appliesTo": "hasCategory(\"MerakiAPIOrg\")", "searchKeywords": "meraki,uplink,cisco,status", "technicalNotes": "Requires custom properties:\n- \"meraki.api.key\"\n- \"meraki.org.id\"\n\nSupport Pages:\n- https://www.logicmonitor.com/support/monitoring/networking-firewalls/meraki-cloud-wireless-access-controllers\n- https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-uplink-statuses", "displayedAs": "Uplink Appliance Status", "collectionInterval": "1m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\n\nmodLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n\nemit = modLoader.load(\"lm.emit\", \"0\") // Streamlines emitting data into LM.\nmeraki = modLoader.load(\"cisco.meraki\", \"0\")\nmsg = modLoader.load(\"lm.debug\", \"0\", true)\n\n//msg.print_level = msg.INFO_LEVEL // Uncomment this line to get verbose debug messages on script output.\nmsg.default_context = \"Cisco_Meraki_UplinkApplianceStatus:ad\"\n\ndef token = hostProps.get(\"meraki.api.key\")\ndef orgId = hostProps.get(\"meraki.org.id\", hostProps.get(\"auto.meraki.org.id\"))\n\n//Check if API key is present\nif (!token) {\n msg.error(\"API key missing; device property meraki.api.key must be set.\")\n return 1\n}\nif (!orgId) {\n msg.error(\"No org ID found; undefined meraki.org.id property.\")\n return 1\n}\n\ndef networks = meraki.cachedHttpGet(token, \"/organizations/${orgId}/networks\")\ndef status = meraki.cachedHttpGet(token, \"/organizations/${orgId}/appliance/uplink/statuses\")\nstatus.each { device ->\n network = networks.find{it.id == device.networkId}\n device.uplinks?.each { link ->\n String wildvalue = \"${device.serial}_${link.interface}\".replaceAll(/(=|:)/,\"_\")\n Map ilp = [\"network_name\": network.name,\n \"ip_assigned_by\": link.ipAssignedBy,\n \"uplink_status\":link.status]\n\n emit.instance(wildvalue, \"${device.serial} - ${link.interface}\", \"IP: ${link.ip} | Public IP: ${link.publicIp} | Primary DNS: ${link.primaryDns}\", ilp)\n }\n}\n\nreturn 0"}, "groupMethod": "ilp", "groupExpr": "auto.network_name"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\n\nmodLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n\nemit = modLoader.load(\"lm.emit\", \"0\") // Streamlines emitting data into LM.\nmeraki = modLoader.load(\"cisco.meraki\", \"0\")\nmsg = modLoader.load(\"lm.debug\", \"0\", true)\nbab = modLoader.load(\"lm.bitsandbobs\", \"0\")\n\n//msg.print_level = msg.INFO_LEVEL // Uncomment this line to get verbose debug messages on script output.\nmsg.default_context = \"Cisco_Meraki_UplinkApplianceStatus:collect\"\n\ndef token = hostProps.get(\"meraki.api.key\")\ndef orgId = hostProps.get(\"meraki.org.id\", hostProps.get(\"auto.meraki.org.id\"))\n\n//Check if API key is present\nif (!token) {\n msg.error(\"API key missing; device property meraki.api.key must be set.\")\n return 1\n}\nif (!orgId) {\n msg.error(\"No org ID found; undefined meraki.org.id property.\")\n return 1\n}\n\ndef response = meraki.httpGet(token, \"/organizations/${orgId}/appliance/uplink/statuses\", [:], \"https://api.meraki.com/api/v1\")\n\nMap status_map = ['not connected': 0,\n 'ready' : 1,\n 'active' : 2,\n 'failed' : 3,\n \"connecting\" : 4]\n\n//Parse and only showing necessary information.\nresponse.each { it ->\n it.uplinks?.each { link ->\n def wildvalue = \"${it.serial}_${link.interface}\"\n Integer status = status_map[link.status.toString()]\n if (status == null) {\n msg.warn(\"Could not decode ${link.status} into a status\")\n }\n\n emit.dp(wildvalue, \"status\", status)\n\n }\n}\n\nbab.keepAlive(hostProps)\n\nreturn 0"}, "datapoints": [{"name": "Status", "description": "Status of the WAN link.\n\nStatus codes:\n0=not connected, \n1=ready, \n2=active, \n3=failed, \n4=connecting", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.status", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "= 3", "noData": "Do not trigger an alert", "triggerInterval": 4, "clearInterval": 0, "alertBody": "Organization appliance ##INSTANCE## on ##HOST## is reporting a failed connection, placing the host into ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}], "graphs": [{"name": "Status", "title": "Status", "verticalLabel": "status code", "min": -1.0, "max": 4.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Status", "color": "orange", "datapointName": "Status", "isVirtual": false}]}], "overviewGraphs": [{"name": "Failed Uplinks", "title": "Failed Uplinks", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "Status", "datapointName": "Status", "consolidationFn": "max", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "Failed", "expr": "if(eq(status,3),1,0)"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "Failed", "isVirtual": true}]}]}

×DataSource: Cisco_Meraki_UplinkLossAndLatency (22)

{"name": "Cisco_Meraki_UplinkLossAndLatency", "description": "Returns the uplink loss and latency for every MX in the organization.", "appliesTo": "hasCategory(\"MerakiAPIOrg\")", "searchKeywords": "meraki,loss,uplink,latency,cisco,status", "technicalNotes": "Requires custom properties:\n- \"meraki.api.key\"\n- \"meraki.org.id\"\n\nSupport Pages:\n- https://www.logicmonitor.com/support/monitoring/networking-firewalls/meraki-cloud-wireless-access-controllers\n- https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-uplinks-loss-and-latency", "displayedAs": "Uplink Loss And Latency", "collectionInterval": "1m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\n\nmodLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n\nemit = modLoader.load(\"lm.emit\", \"0\") // Streamlines emitting data into LM.\nmeraki = modLoader.load(\"cisco.meraki\", \"0\")\nmsg = modLoader.load(\"lm.debug\", \"0\", true)\n\n//msg.print_level = msg.INFO_LEVEL // Uncomment this line to get verbose debug messages on script output.\nmsg.default_context = \"Cisco_Meraki_UplinkLossAndLatency:ad\"\n\ndef token = hostProps.get(\"meraki.api.key\")\ndef orgId = hostProps.get(\"meraki.org.id\", hostProps.get(\"auto.meraki.org.id\"))\nint pollInterval = 60 //other values seem to cause issues with API calls.\n\n//Check if API key is present\nif (!token) {\n println \"API key missing; device property meraki.api.key must be set.\"\n return 1\n}\nif (!orgId) {\n println \"No org ID found; undefined meraki.org.id property.\"\n return 1\n}\n\ndef networks = meraki.cachedHttpGet(token, \"/organizations/${orgId}/networks\")\ndef uplinks = meraki.cachedHttpGet(token, \"/organizations/${orgId}/devices/uplinksLossAndLatency\")\n\n//Parse and only showing necessary information.\nuplinks.each { uplink ->\n def network = networks.find{it.id == uplink.networkId}\n\n Map ilp = [\"network_name\": network.name,\n 'device': uplink.serial,\n 'uplink':uplink.uplink,\n 'ip':uplink.ip\n ]\n\n String wildvalue = \"${uplink.serial}_${uplink.uplink}_${uplink.ip}\"\n emit.instance(wildvalue, \"${uplink.serial} - ${uplink.uplink} - ${uplink.ip}\", \"IP: ${uplink.ip}\", ilp)\n}\n\nreturn 0\n"}, "groupMethod": "ilp", "groupExpr": "auto.meraki.device"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\n\nmodLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n\nemit = modLoader.load(\"lm.emit\", \"0\") // Streamlines emitting data into LM.\nmeraki = modLoader.load(\"cisco.meraki\", \"0\")\nmsg = modLoader.load(\"lm.debug\", \"0\", true)\nbab = modLoader.load(\"lm.bitsandbobs\", \"0\")\n\n//msg.print_level = msg.INFO_LEVEL // Uncomment this line to get verbose debug messages on script output.\nmsg.default_context = \"Cisco_Meraki_UplinkLossAndLatency:collect\"\n\ndef token = hostProps.get(\"meraki.api.key\")\ndef orgId = hostProps.get(\"meraki.org.id\", hostProps.get(\"auto.meraki.org.id\"))\ndef pollInterval = taskProps.get(\"pollinterval\")?:60\n\n//Check if API key is present\nif (!token) {\n println \"API key missing; device property meraki.api.key must be set.\"\n return 1\n}\nif (!orgId) {\n println \"No org ID found; undefined meraki.org.id property.\"\n return 1\n}\n\ndef response = meraki.httpGet(token, \"/organizations/${orgId}/devices/uplinksLossAndLatency\", ['timespan':pollInterval])\n\n//Parse and only showing necessary information.\nresponse.each { it ->\n\n def tot_latency = 0.0\n def tot_loss_percent = 0.0\n def ts_count = 0\n\n it.timeSeries?.each { ts ->\n if(ts.latencyMs){\n tot_latency += ts.latencyMs\n }\n if(ts.lossPercent){\n tot_loss_percent += ts.lossPercent\n }\n\n if(ts.latencyMs || ts.lossPercent){\n ts_count++\n }\n\n }\n //sanitize instance name\n def wildvalue = \"${it.serial}_${it.uplink}_${it.ip}\".replaceAll(/(=|:)/,\"_\")\n\n // Only report if we've seen some data.\n if(ts_count) {\n emit.dp(wildvalue, \"avg_latency\", (tot_latency/ts_count))\n emit.dp(wildvalue, \"avg_loss_percent\", (tot_loss_percent / ts_count))\n }\n}\n\nbab.keepAlive(hostProps)\n\n\nreturn 0"}, "datapoints": [{"name": "AvgLatency", "description": "Average latency in milliseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_latency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "AvgLossPercent", "description": "Average percent packet loss.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_loss_percent", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Latency", "title": "Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AvgLatency", "datapointName": "AvgLatency", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Latency", "color": "silver", "datapointName": "AvgLatency", "isVirtual": false}]}, {"name": "Loss Percentage", "title": "Loss Percentage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AvgLossPercent", "datapointName": "AvgLossPercent", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Percent Loss", "color": "red", "datapointName": "AvgLossPercent", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Devices by Highest Latency", "title": "Top 10 Devices by Highest Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "AvgLatency", "datapointName": "AvgLatency", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "AvgLatency", "isVirtual": false}]}, {"name": "Top 10 Devices by Highest Loss Percentage", "title": "Top 10 Devices by Highest Loss Percentage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "AvgLossPercent", "datapointName": "AvgLossPercent", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "AvgLossPercent", "isVirtual": false}]}]}

×DataSource: Kubernetes_CoreDNS (868)

{"name": "Kubernetes_CoreDNS", "description": "Monitors Kubernetes CoreDNS activity including cache and DNS metrics.", "appliesTo": "hasCategory(\"KubernetesPod\") && auto.name =~ \"coredns\"", "searchKeywords": "kubernetes,coredns,k8s", "technicalNotes": "Requires Kubernetes cluster be added into monitoring (https://www.logicmonitor.com/support/monitoring/containers/kubernetes/adding-your-kubernetes-cluster-into-monitoring) with CoreDNS installed (see Kubernetes documentation for details on installing CoreDNS).", "displayedAs": "Core DNS", "collectionInterval": "1m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2020 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonOutput\n\n\n// To run in debug mode, set to true\ndef debug = false\n\ndef k8s_info = getKubernetesProperties(hostProps, instanceProps, debug)\ndef rawResponse = queryAPI(\"/metrics\", k8s_info, debug)\ndef parsedResponse = parseMetrics(rawResponse, debug)\n\ndef desiredMetrics_coredns = [\n \"coredns_dns_request_type_count_total\" : [\"type\" : [\"A\", \"AAAA\", \"ANY\", \"PTR\", \"other\"]], // zone \".\"\n \"coredns_cache_hits_total\" : [\"type\" : [\"denial\", \"success\"]],\n \"coredns_cache_size\" : [\"type\" : [\"denial\", \"success\"]], // zone \".\"\n \"coredns_dns_response_rcode_count_total\" : [\"rcode\": [\"NOERROR\", \"NXDOMAIN\"]], // zone \".\"\n \"coredns_forward_request_count_total\" : [],\n \"coredns_forward_response_rcode_count_total\" : [\"rcode\": [\"NOERROR\", \"NXDOMAIN\"]],\n \"coredns_dns_request_duration_seconds\" : [\"le\" : [\"0.00025\", \"0.016\", \"1.024\", \"8.192\", \"+Inf\"]], // zone \".\"\n \"coredns_panic_count_total\" : []\n]\n\n// Container for histogram data to be recalculated into new buckets\ndef reqDurMap = [:]\n\ndef dnsReqTot = parsedResponse[\"coredns_dns_request_count_total\"].findAll { it.labels.zone == \".\" }\nprintln \"coredns_dns_request_count_total=${dnsReqTot.value[0]}\"\n\ndesiredMetrics_coredns.each { metric, params ->\n LMDebugPrint(\"\\n\\nRaw output for ${metric}:\\n\\t${parsedResponse[metric]}\", debug)\n\n if (params) {\n LMDebugPrint(\"Searching for params: ${params}\", debug)\n\n // Check to see if data is provided by zones, only capture \".\" zone\n def zoneData = parsedResponse[metric].findAll{ it.labels.zone == \".\" }\n def prettyOutput = JsonOutput.prettyPrint(JsonOutput.toJson(zoneData))\n \n if (zoneData) {\n LMDebugPrint(\"\\nZone data: ${prettyOutput}\", debug)\n\n params.each { k,v ->\n v.each { entry ->\n LMDebugPrint(\"\\tSearching for entries with ${k}:${entry}...\", debug)\n def data = zoneData.findAll { it.labels[k] == entry }\n LMDebugPrint(\"\\tFound: ${data}\\n\", debug)\n\n // Store request duration values to print later after we recalculate buckets\n if (metric == \"coredns_dns_request_duration_seconds\") {\n reqDurMap[entry] = data.value[0]\n }\n else {\n println \"${metric}_${entry}=${data.value[0]}\"\n }\n }\n }\n }\n else {\n params.each { k,v ->\n v.each { entry ->\n LMDebugPrint(\"\\tSearching for entries with ${k}:${entry}...\", debug)\n def data = parsedResponse[metric].findAll { it.labels[k] == entry }\n LMDebugPrint(\"\\tFound: ${data}\\n\", debug)\n \n println \"${metric}_${entry}=${data.value[0]}\"\n }\n }\n }\n }\n else {\n println \"${metric}=${parsedResponse[metric]?.value[0]}\"\n } \n}\n\n// Print out values for newly defined buckets\nprintln \"coredns_dns_request_duration_seconds_b1=${(reqDurMap[\"0.00025\"])}\"\nprintln \"coredns_dns_request_duration_seconds_b2=${(reqDurMap[\"0.016\"] - reqDurMap[\"0.00025\"])}\"\nprintln \"coredns_dns_request_duration_seconds_b3=${(reqDurMap[\"1.024\"] - reqDurMap[\"0.016\"])}\"\nprintln \"coredns_dns_request_duration_seconds_b4=${(reqDurMap[\"8.192\"] - reqDurMap[\"1.024\"])}\"\nprintln \"coredns_dns_request_duration_seconds_b5=${(reqDurMap[\"+Inf\"] - reqDurMap[\"8.192\"])}\"\n\nreturn 0\n\n\n/**\n * Helper function to print out debug messages for troubleshooting purposes.\n */\ndef LMDebugPrint(message, debug) {\n if (debug) {\n println(message.toString())\n }\n}\n\n\n/**\n * Helper function to create map of K8s props.\n */\ndef getKubernetesProperties(parent_hostProps, parent_instanceProps, debug) {\n def k8s_service_host = parent_hostProps?.get(\"system.hostname\")\n def k8s_service_port = 9153\n\n def k8s_serviceaccount_token = new File('/var/run/secrets/kubernetes.io/serviceaccount/token').text\n\n def k8s_props = [\n k8s_serviceaccount_token: k8s_serviceaccount_token,\n k8s_service_host: k8s_service_host,\n k8s_service_port: k8s_service_port\n ]\n\n LMDebugPrint(\"\"\"The following properties have been set:\n k8s_service_host: ${k8s_service_host}\n k8s_service_port: ${k8s_service_port}\n k8s_serviceaccount_token\"\"\", debug)\n\n return k8s_props\n}\n\n\n/**\n * Helper function to query K8s API (using token for authentication).\n */\ndef queryAPI(String api_endpoint, k8s_info, debug) {\n def headers = [ \"Authorization\" : \"Bearer ${k8s_info.k8s_serviceaccount_token}\" ]\n\n def request = \"http://${k8s_info.k8s_service_host}:${k8s_info.k8s_service_port}${api_endpoint}\".toURL().openConnection()\n \n headers.each{ k,v ->\n request.addRequestProperty(k, v)\n }\n \n if (request.getResponseCode() == 200) {\n return request.content.text\n }\n else {\n LMDebugPrint(\"Non-200 response: ${request.getResponseCode()}\", debug)\n }\n\n return false\n}\n\n\n\n/**\n * Helper function to parse OpenMetrics results into proper data structure.\n */\ndef parseMetrics(body, debug) {\n def metricTypes = [:]\n def metricHelp = [:]\n def metrics = [:]\n\n // Iterate through the metric page, parse and print out metrics\n\n METRIC_TYPES = [\"counter\", \"gauge\", \"histogram\", \"summary\", \"untyped\"]\n METRIC_SUFIXES = [\"_sum\", \"_bucket\", \"_count\", ]\n\n body.eachLine { line ->\n if (line.trim() == \"\") return // Completely ignore empty lines\n def splitLine = line.tokenize(\" \")\n\n if (line.startsWith(\"#\")) {\n if (line.startsWith(\"# HELP\") || line.startsWith(\"# TYPE\")) {\n\n def directiveType = splitLine[1]\n def metricName = splitLine[2]\n\n if (directiveType == \"HELP\") {\n metricHelp[metricName] = line[line.indexOf(metricName) + metricName.size()..-1]\n }\n\n if (directiveType == \"TYPE\") {\n metricTypes[metricName] = splitLine[3]\n }\n }\n }\n else {\n if(splitLine.size() < 2) {\n print(\"ERROR: Invalid line: ${line}\")\n return\n }\n\n def metricDef = splitLine[0]\n def metricLabels = [:]\n def metricName = metricDef\n def metricValue\n def sampleType = \"\"\n\n if(metricDef.contains(\"{\")){\n metricName = metricDef.tokenize(\"{\")[0]\n String labelPayload = metricDef[metricDef.indexOf(\"{\")+1..metricDef.lastIndexOf(\"}\")-1]\n labelPayload.split(/(,)(?=(?:[^\"]|\"[^\"]*\")*$)/).each {\n it = it.trim()\n labelKey = it.tokenize(\"=\")[0]\n labelValue = it[labelKey.size()+2..-2]\n metricLabels[labelKey] = labelValue\n }\n }\n\n for (String suffix : METRIC_SUFIXES) {\n if (metricName.endsWith(suffix)) {\n sampleType = suffix\n metricName = metricName.substring(0, metricName.size()-suffix.size())\n }\n }\n\n metricValue = splitLine[1]\n\n if (metrics[metricName]) {\n def refVar = metrics[metricName]\n def data = [\n \"labels\": metricLabels,\n \"sampleType\": sampleType,\n \"value\": metricValue.toDouble() ?: metricValue,\n \"type\": metricTypes.get(metricName, \"untyped\")\n ]\n if (splitLine.size() == 3) {\n metricTimestamp = splitLine[3]\n data[\"timestamp\"] = metricTimestamp\n }\n refVar << data\n }\n else {\n // LMDebugPrint(\"Entry does not exist, adding ${metricName}...\", debug)\n def metric = [\n (metricName): [\n [\n \"labels\": metricLabels,\n \"sampleType\": sampleType,\n \"value\": metricValue.toDouble() ?: metricValue,\n \"type\": metricTypes.get(metricName, \"untyped\")\n ]\n ]\n ]\n if (splitLine.size() == 3) {\n metricTimestamp = splitLine[3]\n metric[\"timestamp\"] = metricTimestamp\n }\n metrics << metric\n }\n\n }\n }\n return metrics\n}"}, "datapoints": [{"name": "cacheHitsTotalDenial", "description": "The count of cache hits for denials.", "interpretMethod": "namevalue", "interpretExpr": "coredns_cache_hits_total_denial", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cacheHitsTotalSuccess", "description": "The count of cache hits for successes.", "interpretMethod": "namevalue", "interpretExpr": "coredns_cache_hits_total_success", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cacheSizeDenial", "description": "The number of elements in the cache for denials.", "interpretMethod": "namevalue", "interpretExpr": "coredns_cache_size_denial", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cacheSizeSuccess", "description": "The number of elements in the cache for successes.", "interpretMethod": "namevalue", "interpretExpr": "coredns_cache_size_success", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dnsReqDurationB1Percent", "description": "Percent of DNS requests that take <= 0.00025 seconds.", "interpretMethod": "expression", "interpretExpr": "(dnsRequestDurationB1 / (dnsRequestDurationB1 + dnsRequestDurationB2 + dnsRequestDurationB3 + dnsRequestDurationB4 + dnsRequestDurationB5)) * 100", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 2}, {"name": "dnsReqDurationB2Percent", "description": "Percent of DNS requests that take <= 0.016 to > 0.00025 seconds.", "interpretMethod": "expression", "interpretExpr": "(dnsRequestDurationB2 / (dnsRequestDurationB1 + dnsRequestDurationB2 + dnsRequestDurationB3 + dnsRequestDurationB4 + dnsRequestDurationB5)) * 100", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 2}, {"name": "dnsReqDurationB3Percent", "description": "Percent of DNS requests that take <= 1.024 to > 0.016 seconds.", "interpretMethod": "expression", "interpretExpr": "(dnsRequestDurationB3 / (dnsRequestDurationB1 + dnsRequestDurationB2 + dnsRequestDurationB3 + dnsRequestDurationB4 + dnsRequestDurationB5)) * 100", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 2}, {"name": "dnsReqDurationB4Percent", "description": "Percent of DNS requests that take <= 8.192 to > 1.024 seconds.", "interpretMethod": "expression", "interpretExpr": "(dnsRequestDurationB4 / (dnsRequestDurationB1 + dnsRequestDurationB2 + dnsRequestDurationB3 + dnsRequestDurationB4 + dnsRequestDurationB5)) * 100", "type": "gauge", "dataType": 7, "threshold": ">= 0.5", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 2, "alertBody": "Kubernetes CoreDNS on ##HOST## is reporting a high number of DNS requests taking 1.024 to 8.192 seconds (##VALUE##%), placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "dnsReqDurationB5Percent", "description": "Percent of DNS requests that take > 8.192 seconds.", "interpretMethod": "expression", "interpretExpr": "(dnsRequestDurationB5 / (dnsRequestDurationB1 + dnsRequestDurationB2 + dnsRequestDurationB3 + dnsRequestDurationB4 + dnsRequestDurationB5)) * 100", "type": "gauge", "dataType": 7, "threshold": ">= 0.5 0.5", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 2, "alertBody": "Kubernetes CoreDNS on ##HOST## is reporting a high number of DNS requests taking longer than 8.192 seconds (##VALUE##%), placing the host into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "dnsRequestDurationB1", "description": "Count of requests that took <= 0.00025 seconds across all zones.", "interpretMethod": "namevalue", "interpretExpr": "coredns_dns_request_duration_seconds_b1", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dnsRequestDurationB2", "description": "Count of requests that took <= 0.016 and > 0.00025 seconds across all zones.", "interpretMethod": "namevalue", "interpretExpr": "coredns_dns_request_duration_seconds_b2", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dnsRequestDurationB3", "description": "Count of requests that took <= 1.024 and > 0.016 seconds across all zones.", "interpretMethod": "namevalue", "interpretExpr": "coredns_dns_request_duration_seconds_b3", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dnsRequestDurationB4", "description": "Count of requests that took <= 8.192 and > 1.024 seconds across all zones.", "interpretMethod": "namevalue", "interpretExpr": "coredns_dns_request_duration_seconds_b4", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dnsRequestDurationB5", "description": "Count of requests that took > 8.192 seconds across all zones.", "interpretMethod": "namevalue", "interpretExpr": "coredns_dns_request_duration_seconds_b5", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dnsRequestTotal", "description": "Counter of total DNS requests made across zone, protocol and family.", "interpretMethod": "namevalue", "interpretExpr": "coredns_dns_request_count_total", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dnsRequestTotalTypeA", "description": "Counter of DNS requests per A record type.", "interpretMethod": "namevalue", "interpretExpr": "coredns_dns_request_type_count_total_A", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dnsRequestTotalTypeAAAA", "description": "Counter of DNS requests per AAAA record type.", "interpretMethod": "namevalue", "interpretExpr": "coredns_dns_request_type_count_total_AAAA", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dnsRequestTotalTypeOther", "description": "Counter of DNS requests per other record type.", "interpretMethod": "namevalue", "interpretExpr": "coredns_dns_request_type_count_total_other", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dnsRequestTotalTypePTR", "description": "Counter of DNS requests per PTR record type.", "interpretMethod": "namevalue", "interpretExpr": "coredns_dns_request_type_count_total_PTR", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dnsResponseTotalRcodeNOERROR", "description": "Counter of responses with status code NOERROR.", "interpretMethod": "namevalue", "interpretExpr": "coredns_dns_response_rcode_count_total_NOERROR", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dnsResponseTotalRcodeNXDOMAIN", "description": "Counter of responses with status code NXDOMAIN.", "interpretMethod": "namevalue", "interpretExpr": "coredns_dns_response_rcode_count_total_NXDOMAIN", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "forwardRequestTotal", "description": "Counter of requests made per upstream.", "interpretMethod": "namevalue", "interpretExpr": "coredns_forward_request_count_total", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "forwardResponseTotalRcodeNOERROR", "description": "Counter of requests made per upstream with response code NOERROR.", "interpretMethod": "namevalue", "interpretExpr": "coredns_forward_response_rcode_count_total_NOERROR", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "forwardResponseTotalRcodeNXDOMAIN", "description": "Counter of requests made per upstream with response code NXDOMAIN.", "interpretMethod": "namevalue", "interpretExpr": "coredns_forward_response_rcode_count_total_NXDOMAIN", "useValue": "output", "type": "counter", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "panicTotal", "description": "Count of total number of panics.", "interpretMethod": "namevalue", "interpretExpr": "coredns_panic_count_total", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Cache Hits", "title": "Cache Hits", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cache_hits_total_denial", "datapointName": "cacheHitsTotalDenial", "consolidationFn": "max"}, {"name": "cache_hits_total_success", "datapointName": "cacheHitsTotalSuccess", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Total denial", "color": "red2", "datapointName": "cache_hits_total_denial", "isVirtual": false}, {"type": "line", "legend": "Total success", "color": "green", "datapointName": "cache_hits_total_success", "isVirtual": false}]}, {"name": "Cache Size", "title": "Cache Size", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cache_size_denial", "datapointName": "cacheSizeDenial", "consolidationFn": "max"}, {"name": "cache_size_success", "datapointName": "cacheSizeSuccess", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "Total denial", "color": "red2", "datapointName": "cache_size_denial", "isVirtual": false}, {"type": "stack", "legend": "Total success", "color": "green", "datapointName": "cache_size_success", "isVirtual": false}]}, {"name": "DNS Request Duration (seconds)", "title": "DNS Request Duration (seconds)", "verticalLabel": "count", "min": 0.0, "displayPriority": 22, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "dnsRequestDurationB1", "datapointName": "dnsRequestDurationB1", "consolidationFn": "max"}, {"name": "dnsRequestDurationB2", "datapointName": "dnsRequestDurationB2", "consolidationFn": "max"}, {"name": "dnsRequestDurationB3", "datapointName": "dnsRequestDurationB3", "consolidationFn": "max"}, {"name": "dnsRequestDurationB4", "datapointName": "dnsRequestDurationB4", "consolidationFn": "max"}, {"name": "dnsRequestDurationB5", "datapointName": "dnsRequestDurationB5", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "<= 0.00025 seconds", "color": "blue", "datapointName": "dnsRequestDurationB1", "isVirtual": false}, {"type": "stack", "legend": "<= 0.016 to > 0.00025 seconds", "color": "olive", "datapointName": "dnsRequestDurationB2", "isVirtual": false}, {"type": "stack", "legend": "<= 1.024 to > 0.016 seconds", "color": "yellow", "datapointName": "dnsRequestDurationB3", "isVirtual": false}, {"type": "stack", "legend": "<= 8.192 to > 1.024 seconds", "color": "orange2", "datapointName": "dnsRequestDurationB4", "isVirtual": false}, {"type": "stack", "legend": "> 8.192 seconds", "color": "red", "datapointName": "dnsRequestDurationB5", "isVirtual": false}]}, {"name": "DNS Requests by Type", "title": "DNS Requests by Type", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "dns_request_total", "datapointName": "dnsRequestTotal", "consolidationFn": "max"}, {"name": "dns_request_total_type_A", "datapointName": "dnsRequestTotalTypeA", "consolidationFn": "max"}, {"name": "dns_request_total_type_AAAA", "datapointName": "dnsRequestTotalTypeAAAA", "consolidationFn": "max"}, {"name": "dns_request_total_type_PTR", "datapointName": "dnsRequestTotalTypePTR", "consolidationFn": "max"}, {"name": "dns_request_total_type_other", "datapointName": "dnsRequestTotalTypeOther", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "DNS total requests", "color": "black", "datapointName": "dns_request_total", "isVirtual": false}, {"type": "stack", "legend": "Type A requests", "color": "navy", "datapointName": "dns_request_total_type_A", "isVirtual": false}, {"type": "stack", "legend": "Type AAAA requests", "color": "yellow", "datapointName": "dns_request_total_type_AAAA", "isVirtual": false}, {"type": "stack", "legend": "Type PTR requests", "color": "fuchsia", "datapointName": "dns_request_total_type_PTR", "isVirtual": false}, {"type": "stack", "legend": "Type other requests", "color": "orange2", "datapointName": "dns_request_total_type_other", "isVirtual": false}]}, {"name": "DNS Response by Response Code", "title": "DNS Response by Response Code", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 25, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "dns_request_total", "datapointName": "dnsRequestTotal", "consolidationFn": "max"}, {"name": "dns_response_total_rcode_NOERROR", "datapointName": "dnsResponseTotalRcodeNOERROR", "consolidationFn": "max"}, {"name": "dns_response_total_rcode_NXDOMAIN", "datapointName": "dnsResponseTotalRcodeNXDOMAIN", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Total DNS requests", "color": "black", "datapointName": "dns_request_total", "isVirtual": false}, {"type": "stack", "legend": "Response code NOERROR", "color": "olive", "datapointName": "dns_response_total_rcode_NOERROR", "isVirtual": false}, {"type": "stack", "legend": "Response code NXDOMAIN", "color": "red", "datapointName": "dns_response_total_rcode_NXDOMAIN", "isVirtual": false}]}, {"name": "Forward Response by Response Code", "title": "Forward Response by Response Code", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "forward_request_total", "datapointName": "forwardRequestTotal", "consolidationFn": "max"}, {"name": "forward_response_total_rcode_NOERROR", "datapointName": "forwardResponseTotalRcodeNOERROR", "consolidationFn": "max"}, {"name": "forward_response_total_rcode_NXDOMAIN", "datapointName": "forwardResponseTotalRcodeNXDOMAIN", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Total forward requests", "color": "black", "datapointName": "forward_request_total", "isVirtual": false}, {"type": "stack", "legend": "Response code NOERROR", "color": "olive", "datapointName": "forward_response_total_rcode_NOERROR", "isVirtual": false}, {"type": "stack", "legend": "Response code NXDOMAIN", "color": "orange2", "datapointName": "forward_response_total_rcode_NXDOMAIN", "isVirtual": false}]}, {"name": "Panic Totals", "title": "Panic Totals", "verticalLabel": "count", "min": 0.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "panicTotal", "datapointName": "panicTotal", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Total", "color": "orange", "datapointName": "panicTotal", "isVirtual": false}]}, {"name": "Percent DNS Request Duration (seconds)", "title": "Percent DNS Request Duration (seconds)", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 23, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "dnsRequestDurationB1", "datapointName": "dnsReqDurationB1Percent", "consolidationFn": "max"}, {"name": "dnsRequestDurationB2", "datapointName": "dnsReqDurationB2Percent", "consolidationFn": "max"}, {"name": "dnsRequestDurationB3", "datapointName": "dnsReqDurationB3Percent", "consolidationFn": "max"}, {"name": "dnsRequestDurationB4", "datapointName": "dnsReqDurationB4Percent", "consolidationFn": "max"}, {"name": "dnsRequestDurationB5", "datapointName": "dnsReqDurationB5Percent", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "<= 0.00025 seconds", "color": "blue", "datapointName": "dnsRequestDurationB1", "isVirtual": false}, {"type": "stack", "legend": "<= 0.016 to > 0.00025 seconds", "color": "olive", "datapointName": "dnsRequestDurationB2", "isVirtual": false}, {"type": "stack", "legend": "<= 1.024 to > 0.016 seconds", "color": "yellow", "datapointName": "dnsRequestDurationB3", "isVirtual": false}, {"type": "stack", "legend": "<= 8.192 to > 1.024 seconds", "color": "orange2", "datapointName": "dnsRequestDurationB4", "isVirtual": false}, {"type": "stack", "legend": "> 8.192 seconds", "color": "red", "datapointName": "dnsRequestDurationB5", "isVirtual": false}]}]}

×DataSource: LogicMonitor_Portal_Alerts (862)

{"name": "LogicMonitor_Portal_Alerts", "description": "Monitor alerts on a LogicMonitor account.", "appliesTo": "hasCategory(\"LogicMonitorPortal\") && system.displayname =~ \".logicmonitor.com\"", "searchKeywords": "logicmonitor,portal metrics,api", "technicalNotes": "This module requires the \"addCategory_LogicMonitorPortal\" PropertySource to be installed, a device with a hostname and displayname including \"logicmonitor.com\", and the following properties configured:\n\nlmaccess.id - API Token ID\nlmaccess.key - API Token key\nlmaccount - (optional) Name of your LM account. This will default to whatever account this is running on.", "displayedAs": "LogicMonitor Alerts", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// Create instances for each alert severity regardless of whether there are alerts present\nprintln '4##Critical Alerts######auto.alert.severity=critical'\nprintln '3##Error Alerts######auto.alert.severity=error'\nprintln '2##Warning Alerts######auto.alert.severity=warning'"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.live.LiveHostSet\nimport org.apache.commons.codec.binary.Hex\nimport javax.crypto.Mac\nimport javax.crypto.spec.SecretKeySpec\nimport java.security.MessageDigest\n\n\nString apiId = hostProps.get(\"lmaccess.id\")?:hostProps.get(\"logicmonitor.access.id\")\nString apiKey = hostProps.get(\"lmaccess.key\")?:hostProps.get(\"logicmonitor.access.key\")\ndef portalName = hostProps.get(\"lmaccount\")?:Settings.getSetting(Settings.AGENT_COMPANY)\ndef collectorProxy = Settings.getSetting(\"proxy.enable\").toBoolean()\nMap proxyInfo = [:]\n\nif (collectorProxy) {\n proxyInfo = [\n enabled : true,\n host : Settings.getSetting(\"proxy.host\"),\n port : Settings.getSetting(\"proxy.port\"),\n user : Settings.getSetting(\"proxy.user\"),\n pass : Settings.getSetting(\"proxy.pass\")\n ]\n\n proxyInfo[\"proxy\"] = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo.host, proxyInfo.port.toInteger()))\n}\n\ndef alerts = apiGetManyV2(portalName, apiId, apiKey, \"/alert/alerts\", proxyInfo, ['size':1000])\n\ndef criticalAlerts = alerts.findAll { it.severity == 4 }\ndef errorAlerts = alerts.findAll { it.severity == 3 }\ndef warningAlerts = alerts.findAll { it.severity == 2 }\n\nalertResults(criticalAlerts, 4)\nalertResults(errorAlerts, 3)\nalertResults(warningAlerts, 2)\n\nreturn 0\n\n\n/* Paginated GET method. Returns a list of objects. */\nList apiGetManyV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n\n def pageSize = args.get('size', 1000) // Default the page size to 1000 if not specified.\n List items = []\n\n args['size'] = pageSize\n\n def pageCount = 0\n while (true) {\n pageCount += 1\n\n // Updated the args\n args['size'] = pageSize\n args['offset'] = items.size()\n\n def response = apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (response.get(\"errmsg\", \"OK\") != \"OK\") {\n throw new Exception(\"Santaba returned errormsg: ${payload?.errmsg}\")\n }\n items.addAll(response.items)\n\n // If we recieved less than we asked for it means we are done\n if (response.items.size() < pageSize) break\n }\n return items\n}\n\n\n/* Simple GET, returns a parsed json payload. No processing. */\ndef apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def request = rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (request.getResponseCode() == 200) {\n def payload = new JsonSlurper().parseText(request.content.text)\n return payload\n }\n else {\n throw new Exception(\"Server return HTTP code ${request.getResponseCode()}\")\n }\n}\n\n\n/* Raw GET method. */\ndef rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def auth = generateAuth(apiId, apiKey, endPoint)\n def headers = [\"Authorization\": auth, \"Content-Type\": \"application/json\", \"X-Version\":\"2\", \"External-User\":\"true\"]\n def url = \"https://${portalName}.logicmonitor.com/santaba/rest${endPoint}\"\n\n if (args) {\n def encodedArgs = []\n args.each{ k,v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n\n def request\n if (proxyInfo.enabled) {\n request = url.toURL().openConnection(proxyInfo.proxy)\n }\n else {\n request = url.toURL().openConnection()\n }\n request.setRequestMethod(\"GET\")\n request.setDoOutput(true)\n headers.each{ k,v ->\n request.addRequestProperty(k, v)\n }\n\n return request\n}\n\n\n/* Generate auth for API calls. */\nstatic String generateAuth(id, key, path) {\n Long epoch_time = System.currentTimeMillis()\n Mac hmac = Mac.getInstance(\"HmacSHA256\")\n hmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA256\"))\n def signature = Hex.encodeHexString(hmac.doFinal(\"GET${epoch_time}${path}\".getBytes())).bytes.encodeBase64()\n\n return \"LMv1 ${id}:${signature}:${epoch_time}\"\n}\n\n\n/* Helper method to remind the collector this device is not dead */\ndef keepAlive(hostProps) {\n // Update the liveHost set so tell the collector we are happy.\n hostId = hostProps.get(\"system.deviceId\").toInteger()\n def liveHostSet = LiveHostSet.getInstance()\n liveHostSet.flag(hostId)\n}\n\n\n/* Print results for JSON object of alert severity. */\ndef alertResults(JSON, wildvalue) {\n if (JSON.size() > 0) {\n println \"${wildvalue}.totalAlerts=${JSON.size()}\"\n println \"${wildvalue}.sdted=${JSON.findAll { it.sdted }.size()}\"\n println \"${wildvalue}.acked=${JSON.findAll { it.acked }.size()}\"\n println \"${wildvalue}.SDT=${JSON.findAll { it.SDT != null }.size()}\"\n }\n // Print all 0s if no alerts for severity\n else {\n println \"${wildvalue}.totalAlerts=0\"\n println \"${wildvalue}.sdted=0\"\n println \"${wildvalue}.acked=0\"\n println \"${wildvalue}.SDT=0\"\n }\n}"}, "datapoints": [{"name": "SDT", "description": "Count of alerts that occurred while already in SDT for specified severity level.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.SDT", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "acked", "description": "Count of alerts that were acknowledged for specified severity level.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.acked", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sdted", "description": "Count of alerts that were put into SDT for specified severity level.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sdted", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "totalAlerts", "description": "Total count of alerts for specified severity level.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totalAlerts", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Alerts", "title": "Alerts", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SDT", "datapointName": "SDT", "consolidationFn": "max"}, {"name": "acked", "datapointName": "acked", "consolidationFn": "max"}, {"name": "sdted", "datapointName": "sdted", "consolidationFn": "max"}, {"name": "totalAlerts", "datapointName": "totalAlerts", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "SDT", "color": "navy", "datapointName": "SDT", "isVirtual": false}, {"type": "stack", "legend": "acked", "color": "fuchsia", "datapointName": "acked", "isVirtual": false}, {"type": "stack", "legend": "sdted", "color": "aqua", "datapointName": "sdted", "isVirtual": false}, {"type": "area", "legend": "totalAlerts", "color": "yellow", "datapointName": "totalAlerts", "isVirtual": false}]}], "overviewGraphs": [{"name": "Total Alerts", "title": "Total Alerts", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "totalAlerts", "datapointName": "totalAlerts", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "totalAlerts", "isVirtual": false}]}]}

×DataSource: LogicMonitor_Portal_Collectors (368)

{"name": "LogicMonitor_Portal_Collectors", "description": "Monitor collectors on a LogicMonitor account.", "appliesTo": "hasCategory(\"LogicMonitorPortal\") && system.displayname =~ \".logicmonitor.com\"", "searchKeywords": "logicmonitor,portal metrics,api,collector", "technicalNotes": "This module requires the \"addCategory_LogicMonitorPortal\" PropertySource to be installed, a device with a hostname and displayname including \"logicmonitor.com\", and the following properties configured:\n\nlmaccess.id - API Token ID\nlmaccess.key - API Token key\nlmaccount - (optional) Name of your LM account. This will default to whatever account this is running on.", "displayedAs": "LogicMonitor Collectors", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// Create instances for each collector platform regardless of whether there are collectors\nprintln '0##Linux Collectors######auto.collector.platform=linux'\nprintln '1##Windows Collectors######auto.collector.platform=windows'"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.live.LiveHostSet\nimport org.apache.commons.codec.binary.Hex\nimport javax.crypto.Mac\nimport javax.crypto.spec.SecretKeySpec\nimport java.security.MessageDigest\n\n\nString apiId = hostProps.get(\"lmaccess.id\")?:hostProps.get(\"logicmonitor.access.id\")\nString apiKey = hostProps.get(\"lmaccess.key\")?:hostProps.get(\"logicmonitor.access.key\")\ndef portalName = hostProps.get(\"lmaccount\")?:Settings.getSetting(Settings.AGENT_COMPANY)\ndef collectorProxy = Settings.getSetting(\"proxy.enable\").toBoolean()\nMap proxyInfo = [:]\n\nif (collectorProxy) {\n proxyInfo = [\n enabled : true,\n host : Settings.getSetting(\"proxy.host\"),\n port : Settings.getSetting(\"proxy.port\"),\n user : Settings.getSetting(\"proxy.user\"),\n pass : Settings.getSetting(\"proxy.pass\")\n ]\n\n proxyInfo[\"proxy\"] = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo.host, proxyInfo.port.toInteger()))\n}\n\n// Determine which collectors are in ABCG groups\ndef collectorGroups = apiGetManyV2(portalName, apiId, apiKey, \"/setting/collector/groups\", proxyInfo, ['size':1000])\n\n// Create list of ABCG IDs for processing failover info\n// Workaround due to incorrect data returned for failoverSet and failoverEnabled fields in /setting/collector/collectors\ndef List ABCGids = []\ndef ABCGs = collectorGroups.findAll { it.autoBalance }\nABCGids.addAll(ABCGs.id)\n\n// Get all collectors in portal\ndef collectors = apiGetManyV2(portalName, apiId, apiKey, \"/setting/collector/collectors\", proxyInfo, ['size':1000])\n\ndef linux = collectors.findAll { it.platform == \"linux\" }\ndef windows = collectors.findAll { it.platform == \"windows\" }\n\ncollectorResults(linux, 0, ABCGids)\ncollectorResults(windows, 1, ABCGids)\n\n// If script gets to this point, collector should consider this device alive\nkeepAlive(hostProps)\n\nreturn 0\n\n\n/* Paginated GET method. Returns a list of objects. */\nList apiGetManyV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n\n def pageSize = args.get('size', 1000) // Default the page size to 1000 if not specified.\n List items = []\n\n args['size'] = pageSize\n\n def pageCount = 0\n while (true) {\n pageCount += 1\n\n // Updated the args\n args['size'] = pageSize\n args['offset'] = items.size()\n\n def response = apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (response.get(\"errmsg\", \"OK\") != \"OK\") {\n throw new Exception(\"Santaba returned errormsg: ${payload?.errmsg}\")\n }\n items.addAll(response.items)\n\n // If we recieved less than we asked for it means we are done\n if (response.items.size() < pageSize) break\n }\n return items\n}\n\n\n/* Simple GET, returns a parsed json payload. No processing. */\ndef apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def request = rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (request.getResponseCode() == 200) {\n def payload = new JsonSlurper().parseText(request.content.text)\n return payload\n }\n else {\n throw new Exception(\"Server return HTTP code ${request.getResponseCode()}\")\n }\n}\n\n\n/* Raw GET method. */\ndef rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def auth = generateAuth(apiId, apiKey, endPoint)\n def headers = [\"Authorization\": auth, \"Content-Type\": \"application/json\", \"X-Version\":\"2\", \"External-User\":\"true\"]\n def url = \"https://${portalName}.logicmonitor.com/santaba/rest${endPoint}\"\n\n if (args) {\n def encodedArgs = []\n args.each{ k,v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n\n def request\n if (proxyInfo.enabled) {\n request = url.toURL().openConnection(proxyInfo.proxy)\n }\n else {\n request = url.toURL().openConnection()\n }\n request.setRequestMethod(\"GET\")\n request.setDoOutput(true)\n headers.each{ k,v ->\n request.addRequestProperty(k, v)\n }\n\n return request\n}\n\n\n/* Generate auth for API calls. */\nstatic String generateAuth(id, key, path) {\n Long epoch_time = System.currentTimeMillis()\n Mac hmac = Mac.getInstance(\"HmacSHA256\")\n hmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA256\"))\n def signature = Hex.encodeHexString(hmac.doFinal(\"GET${epoch_time}${path}\".getBytes())).bytes.encodeBase64()\n\n return \"LMv1 ${id}:${signature}:${epoch_time}\"\n}\n\n\n/* Helper method to remind the collector this device is not dead */\ndef keepAlive(hostProps) {\n // Update the liveHost set so tell the collector we are happy.\n hostId = hostProps.get(\"system.deviceId\").toInteger()\n def liveHostSet = LiveHostSet.getInstance()\n liveHostSet.flag(hostId)\n}\n\n\n/* Print results for JSON object of collector type. */\ndef collectorResults(JSON, wildvalue, groupIds) {\n if (JSON.size() > 0) {\n def failoverSet = 0\n def failoverEnabled = 0\n def abcgCollectors = 0\n\n JSON.each { collector ->\n // Add to variables for all collectors in ABCGs which by design have failover set and enabled\n if (groupIds.contains(collector.collectorGroupId)) {\n failoverSet += 1\n failoverEnabled += 1\n abcgCollectors += 1\n }\n // Add to variables for all collectors that have a valid collector ID set for backupAgentId\n // Note: Collectors in ABCGs return a value of 0 for backupAgentId so this will never double count ABCG collectors\n else if (collector.backupAgentId != 0) {\n failoverSet += 1\n failoverEnabled += 1\n }\n }\n\n println \"${wildvalue}.totalCollectors=${JSON.size()}\"\n println \"${wildvalue}.aliveCollectors=${JSON.findAll { it.isDown == false }.size()}\"\n println \"${wildvalue}.downCollectors=${JSON.findAll { it.isDown }.size()}\"\n println \"${wildvalue}.abcgCollectors=${abcgCollectors}\"\n println \"${wildvalue}.eaCollectors=${JSON.findAll { it.ea }.size()}\"\n println \"${wildvalue}.sdtCollectors=${JSON.findAll { it.inSDT }.size()}\"\n println \"${wildvalue}.failbackEnabled=${JSON.findAll { it.enableFailBack }.size()}\"\n println \"${wildvalue}.failoverSet=${failoverSet}\"\n println \"${wildvalue}.failoverEnabled=${failoverEnabled}\"\n // Unable to use the following fields directly due to inaccurate data in response\n // println \"${wildvalue}.failoverSet=${JSON.findAll { it.hasFailOverDevice }.size()}\"\n // println \"${wildvalue}.failoverEnabled=${JSON.findAll { it.enableFailOverOnCollectorDevice }.size()}\"\n }\n // Print all 0s if no collectors of specified type\n else {\n println \"${wildvalue}.totalCollectors=0\"\n println \"${wildvalue}.aliveCollectors=0\"\n println \"${wildvalue}.downCollectors=0\"\n println \"${wildvalue}.abcgCollectors=0\"\n println \"${wildvalue}.eaCollectors=0\"\n println \"${wildvalue}.sdtCollectors=0\"\n println \"${wildvalue}.failbackEnabled=0\"\n println \"${wildvalue}.failoverSet=0\"\n println \"${wildvalue}.failoverEnabled=0\"\n }\n}"}, "datapoints": [{"name": "abcgCollectors", "description": "Count of collectors in auto-balanced collector groups for specified collector platform.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.abcgCollectors", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "aliveCollectors", "description": "Count of alive collectors for specified collector platform.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.aliveCollectors", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "downCollectors", "description": "Count of down collectors for specified collector platform.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.downCollectors", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "eaCollectors", "description": "Count of collectors on an early release version for specified collector platform.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.eaCollectors", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "failbackEnabled", "description": "Count of collectors with failback enabled set for specified collector platform.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.failbackEnabled", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "failoverEnabled", "description": "Count of collectors with failover enabled set for specified collector platform.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.failoverEnabled", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "failoverSet", "description": "Count of collectors with a failover collector set for specified collector platform.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.failoverSet", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sdtCollectors", "description": "Count of collectors in SDT for specified collector platform.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sdtCollectors", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "totalCollectors", "description": "Total count of collector for specified collector platform.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totalCollectors", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "ABCG Collectors", "title": "ABCG Collectors", "verticalLabel": "count", "min": 0.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "abcgCollectors", "datapointName": "abcgCollectors", "consolidationFn": "max"}, {"name": "totalCollectors", "datapointName": "totalCollectors", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "noABCG", "expr": "totalCollectors - abcgCollectors"}], "lines": [{"type": "stack", "legend": "Collectors in ABCG", "color": "lime", "datapointName": "abcgCollectors", "isVirtual": false}, {"type": "stack", "legend": "Collectors not in ABCG", "color": "orange2", "datapointName": "noABCG", "isVirtual": true}, {"type": "line", "legend": "Total collectors", "color": "black", "datapointName": "totalCollectors", "isVirtual": false}]}, {"name": "Collector Failover Status", "title": "Collector Failover Status", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "failoverEnabled", "datapointName": "failoverEnabled", "consolidationFn": "max"}, {"name": "failoverSet", "datapointName": "failoverSet", "consolidationFn": "max"}, {"name": "totalCollectors", "datapointName": "totalCollectors", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "noFailover", "expr": "totalCollectors - failoverSet"}], "lines": [{"type": "line", "legend": "Failover enabled", "color": "navy", "datapointName": "failoverEnabled", "isVirtual": false}, {"type": "stack", "legend": "Failover set", "color": "olive", "datapointName": "failoverSet", "isVirtual": false}, {"type": "stack", "legend": "No failover set", "color": "red", "datapointName": "noFailover", "isVirtual": true}, {"type": "line", "legend": "Total collectors", "color": "black", "datapointName": "totalCollectors", "isVirtual": false}]}, {"name": "Collector Status", "title": "Collector Status", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "aliveCollectors", "datapointName": "aliveCollectors", "consolidationFn": "max"}, {"name": "downCollectors", "datapointName": "downCollectors", "consolidationFn": "max"}, {"name": "totalCollectors", "datapointName": "totalCollectors", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "Alive", "color": "olive", "datapointName": "aliveCollectors", "isVirtual": false}, {"type": "stack", "legend": "Down", "color": "red", "datapointName": "downCollectors", "isVirtual": false}, {"type": "line", "legend": "Total collectors", "color": "black", "datapointName": "totalCollectors", "isVirtual": false}]}, {"name": "Collector Version Type", "title": "Collector Version Type", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "eaCollectors", "datapointName": "eaCollectors", "consolidationFn": "max"}, {"name": "totalCollectors", "datapointName": "totalCollectors", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "gaCollectors", "expr": "totalCollectors - eaCollectors"}], "lines": [{"type": "stack", "legend": "Collectors on early release version", "color": "orange2", "datapointName": "eaCollectors", "isVirtual": false}, {"type": "stack", "legend": "Collectors on general release version", "color": "blue", "datapointName": "gaCollectors", "isVirtual": true}, {"type": "line", "legend": "Total collectors", "color": "black", "datapointName": "totalCollectors", "isVirtual": false}]}, {"name": "Collectors in SDT", "title": "Collectors in SDT", "verticalLabel": "count", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "sdtCollectors", "datapointName": "sdtCollectors", "consolidationFn": "max"}, {"name": "totalCollectors", "datapointName": "totalCollectors", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "noSDT", "expr": "totalCollectors - sdtCollectors"}], "lines": [{"type": "stack", "legend": "Collectors not in SDT", "color": "lime", "datapointName": "noSDT", "isVirtual": true}, {"type": "stack", "legend": "Collectors in SDT", "color": "aqua", "datapointName": "sdtCollectors", "isVirtual": false}, {"type": "line", "legend": "Total collectors", "color": "black", "datapointName": "totalCollectors", "isVirtual": false}]}], "overviewGraphs": [{"name": "Down Collectors by Platform", "title": "Down Collectors by Platform", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "downCollectors", "datapointName": "downCollectors", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "stack", "legend": "Down ##INSTANCE##", "color": "silver", "datapointName": "downCollectors", "isVirtual": false}]}, {"name": "Total Collectors by Platform", "title": "Total Collectors by Platform", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "totalCollectors", "datapointName": "totalCollectors", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "stack", "legend": "Total ##INSTANCE##", "color": "silver", "datapointName": "totalCollectors", "isVirtual": false}]}]}

×DataSource: LogicMonitor_Portal_Resources (422)

{"name": "LogicMonitor_Portal_Resources", "description": "Monitor resources on a LogicMonitor account.", "appliesTo": "hasCategory(\"LogicMonitorPortal\") && system.displayname =~ \".logicmonitor.com\"", "searchKeywords": "logicmonitor,portal metrics,api", "technicalNotes": "This module requires the \"addCategory_LogicMonitorPortal\" PropertySource to be installed, a device with a hostname and displayname including \"logicmonitor.com\", and the following properties configured:\n\nlmaccess.id - API Token ID\nlmaccess.key - API Token key\nlmaccount - (optional) Name of your LM account. This will default to whatever account this is running on.", "displayedAs": "LogicMonitor Resources", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.live.LiveHostSet\nimport org.apache.commons.codec.binary.Hex\nimport javax.crypto.Mac\nimport javax.crypto.spec.SecretKeySpec\nimport java.security.MessageDigest\n\n\nString apiId = hostProps.get(\"lmaccess.id\")?:hostProps.get(\"logicmonitor.access.id\")\nString apiKey = hostProps.get(\"lmaccess.key\")?:hostProps.get(\"logicmonitor.access.key\")\ndef portalName = hostProps.get(\"lmaccount\")?:Settings.getSetting(Settings.AGENT_COMPANY)\ndef collectorProxy = Settings.getSetting(\"proxy.enable\").toBoolean()\nMap proxyInfo = [:]\n\n// To run in debug mode, set to true\ndebug = false\n\nif (collectorProxy) {\n proxyInfo = [\n enabled : true,\n host : Settings.getSetting(\"proxy.host\"),\n port : Settings.getSetting(\"proxy.port\"),\n user : Settings.getSetting(\"proxy.user\"),\n pass : Settings.getSetting(\"proxy.pass\")\n ]\n\n proxyInfo[\"proxy\"] = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo.host, proxyInfo.port.toInteger()))\n\n LMDebugPrint(\"\"\"Collector proxy is enabled with the following:\n Host: ${proxyInfo[host]}\n Port: ${proxyInfo[port]}\n \"\"\", debug)\n}\n\ndef fields = 'deviceType,awsState,azureState,gcpState,hostStatus,sdtStatus,enableNetflow,disableAlerting,alertStatus'\ndef devices = apiGetManyV2(portalName, apiId, apiKey, \"/device/devices\", proxyInfo, ['size':1000, 'fields':fields])\n\ndef regDevices = devices.findAll { it.deviceType == 0 }\ndef awsDevices = devices.findAll { it.deviceType == 2 }\ndef azureDevices = devices.findAll { it.deviceType == 4 }\ndef gcpDevices = devices.findAll { it.deviceType == 7 }\ndef services = devices.findAll { it.deviceType == 6 }\ndef kubernetes = devices.findAll { it.deviceType == 8 }\ndef saas = devices.findAll { it.deviceType == 10}\n\n// Only create instances if resources are discovered for that device type\nif (regDevices.size() > 0) {\n println '0##Standard Resources######auto.deviceType=Regular'\n}\nif (awsDevices.size() > 0) {\n println '2##AWS Resources######auto.deviceType=AWS'\n}\nif (azureDevices.size() > 0) {\n println '4##Azure Resources######auto.deviceType=Azure'\n}\nif (gcpDevices.size() > 0) {\n println '7##GCP Resources######auto.deviceType=GCP'\n}\nif (services.size() > 0) {\n println \"6##LM Services######auto.deviceType=Services\"\n}\nif (kubernetes.size() > 0) {\n println \"8##Kubernetes Resources######auto.deviceType=Kubernetes\"\n}\nif (saas.size() > 0) {\n println \"10##SaaS Resources######auto.deviceType=Saas\"\n}\n\n// If script gets to this point, collector should consider this device alive\nkeepAlive(hostProps)\n\nreturn 0\n\n\n/**\n * Helper function to print out debug messages for troubleshooting purposes.\n */\ndef LMDebugPrint(message, debug=false) {\n if (debug) {\n println(message.toString())\n }\n}\n\n\n/* Paginated GET method. Returns a list of objects. */\nList apiGetManyV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n\n def pageSize = args.get('size', 1000) // Default the page size to 1000 if not specified.\n List items = []\n\n args['size'] = pageSize\n\n def pageCount = 0\n while (true) {\n pageCount += 1\n\n // Updated the args\n args['size'] = pageSize\n args['offset'] = items.size()\n\n def response = apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (response.get(\"errmsg\", \"OK\") != \"OK\") {\n throw new Exception(\"Santaba returned errormsg: ${payload?.errmsg}\")\n }\n items.addAll(response.items)\n\n // If we recieved less than we asked for it means we are done\n if (response.items.size() < pageSize) break\n }\n return items\n}\n\n\n/* Simple GET, returns a parsed json payload. No processing. */\ndef apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def request = rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n\n def rc = request.getResponseCode()\n\n if (rc == 200) {\n def payload = new JsonSlurper().parseText(request.content.text)\n LMDebugPrint(\"Success ${rc}\", debug)\n return payload\n }\n else {\n throw new Exception(\"Server return HTTP code ${rc}\")\n }\n}\n\n\n/* Raw GET method. */\ndef rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def auth = generateAuth(apiId, apiKey, endPoint)\n def headers = [\"Authorization\": auth, \"Content-Type\": \"application/json\", \"X-Version\":\"2\", \"External-User\":\"true\"]\n def url = \"https://${portalName}.logicmonitor.com/santaba/rest${endPoint}\"\n\n if (args) {\n def encodedArgs = []\n args.each{ k,v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n LMDebugPrint(\"Querying ${url}...\", debug)\n\n def request\n if (proxyInfo.enabled) {\n request = url.toURL().openConnection(proxyInfo.proxy)\n }\n else {\n request = url.toURL().openConnection()\n }\n request.setRequestMethod(\"GET\")\n request.setDoOutput(true)\n headers.each{ k,v ->\n request.addRequestProperty(k, v)\n }\n\n return request\n}\n\n\n/* Generate auth for API calls. */\nstatic String generateAuth(id, key, path) {\n Long epoch_time = System.currentTimeMillis()\n Mac hmac = Mac.getInstance(\"HmacSHA256\")\n hmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA256\"))\n def signature = Hex.encodeHexString(hmac.doFinal(\"GET${epoch_time}${path}\".getBytes())).bytes.encodeBase64()\n\n return \"LMv1 ${id}:${signature}:${epoch_time}\"\n}\n\n\n/* Helper method to remind the collector this device is not dead */\ndef keepAlive(hostProps) {\n // Update the liveHost set so tell the collector we are happy.\n hostId = hostProps.get(\"system.deviceId\").toInteger()\n def liveHostSet = LiveHostSet.getInstance()\n liveHostSet.flag(hostId)\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.live.LiveHostSet\nimport org.apache.commons.codec.binary.Hex\nimport javax.crypto.Mac\nimport javax.crypto.spec.SecretKeySpec\nimport java.security.MessageDigest\n\n\nString apiId = hostProps.get(\"lmaccess.id\")?:hostProps.get(\"logicmonitor.access.id\")\nString apiKey = hostProps.get(\"lmaccess.key\")?:hostProps.get(\"logicmonitor.access.key\")\ndef portalName = hostProps.get(\"lmaccount\")?:Settings.getSetting(Settings.AGENT_COMPANY)\ndef collectorProxy = Settings.getSetting(\"proxy.enable\").toBoolean()\nMap proxyInfo = [:]\n\n// To run in debug mode, set to true\ndebug = false\n\nif (collectorProxy) {\n proxyInfo = [\n enabled : true,\n host : Settings.getSetting(\"proxy.host\"),\n port : Settings.getSetting(\"proxy.port\"),\n user : Settings.getSetting(\"proxy.user\"),\n pass : Settings.getSetting(\"proxy.pass\")\n ]\n\n proxyInfo[\"proxy\"] = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo.host, proxyInfo.port.toInteger()))\n\n LMDebugPrint(\"\"\"Collector proxy is enabled with the following:\n Host: ${proxyInfo[host]}\n Port: ${proxyInfo[port]}\n \"\"\", debug)\n}\ndef fields = 'deviceType,awsState,azureState,gcpState,hostStatus,sdtStatus,enableNetflow,disableAlerting,alertStatus'\ndef devices = apiGetManyV2(portalName, apiId, apiKey, \"/device/devices\", proxyInfo, ['size':1000, 'fields':fields])\ndef summary = apiGetV2(portalName, apiId, apiKey, \"/metrics/summary\", proxyInfo)\n\ndef regDevices = devices.findAll { it.deviceType == 0 }\ndef awsDevices = devices.findAll { it.deviceType == 2 }\ndef azureDevices = devices.findAll { it.deviceType == 4 }\ndef gcpDevices = devices.findAll { it.deviceType == 7 }\ndef services = devices.findAll { it.deviceType == 6 }\ndef kubernetes = devices.findAll { it.deviceType == 8 }\ndef saas = devices.findAll { it.deviceType == 10}\n\ndeviceResults(regDevices, 0)\nprintln \"0.cloudOnly=0\"\ndeviceResults(awsDevices, 2)\nprintln \"2.cloudOnly=${summary.numOfCombinedAWSDevices}\"\ndeviceResults(azureDevices, 4)\nprintln \"4.cloudOnly=${summary.numOfCombinedAzureDevices}\"\ndeviceResults(gcpDevices, 7)\nprintln \"7.cloudOnly=${summary.numOfCombinedGcpDevices}\"\ndeviceResults(services, 6)\nprintln \"6.cloudOnly=0\"\ndeviceResults(kubernetes, 8)\nprintln \"8.cloudOnly=0\"\ndeviceResults(saas, 10)\nprintln \"10.cloudOnly=${saas.size()}\"\n\n// Identify uncounted resources\nif (devices.size() != (regDevices.size() + awsDevices.size() + azureDevices.size() + gcpDevices.size() + services.size() + kubernetes.size()) + saas.size()) {\n LMDebugPrint(\"Missing some devices\", debug)\n // The following code is for troubleshooting to identify unknown device types\n devices.each { device ->\n if (device.deviceType != 0\n && device.deviceType != 2\n && device.deviceType != 4\n && device.deviceType != 7\n && device.deviceType != 6\n && device.deviceType != 8\n && device.deviceType != 10) {\n LMDebugPrint(\"Type is ${device.deviceType}\", debug)\n LMDebugPrint(device, debug)\n }\n }\n}\n\n// If script gets to this point, collector should consider this device alive\nkeepAlive(hostProps)\n\nreturn 0\n\n\n/**\n * Helper function to print out debug messages for troubleshooting purposes.\n */\ndef LMDebugPrint(message, debug=false) {\n if (debug) {\n println(message.toString())\n }\n}\n\n\n/* Paginated GET method. Returns a list of objects. */\nList apiGetManyV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def pageSize = args.get('size', 1000) // Default the page size to 1000 if not specified.\n List items = []\n\n args['size'] = pageSize\n\n def pageCount = 0\n while (true) {\n pageCount += 1\n\n // Updated the args\n args['size'] = pageSize\n args['offset'] = items.size()\n\n def response = apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (response.get(\"errmsg\", \"OK\") != \"OK\") {\n throw new Exception(\"Santaba returned errormsg: ${payload?.errmsg}\")\n }\n items.addAll(response.items)\n\n // If we recieved less than we asked for it means we are done\n if (response.items.size() < pageSize) break\n }\n return items\n}\n\n\n/* Simple GET, returns a parsed json payload. No processing. */\ndef apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def request = rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n\n def rc = request.getResponseCode()\n\n if (rc == 200) {\n def payload = new JsonSlurper().parseText(request.content.text)\n LMDebugPrint(\"Success ${rc}\", debug)\n return payload\n }\n else {\n throw new Exception(\"Server return HTTP code ${rc}\")\n }\n}\n\n\n/* Raw GET method. */\ndef rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def auth = generateAuth(apiId, apiKey, endPoint)\n def headers = [\"Authorization\": auth, \"Content-Type\": \"application/json\", \"X-Version\":\"2\", \"External-User\":\"true\"]\n def url = \"https://${portalName}.logicmonitor.com/santaba/rest${endPoint}\"\n\n\n if (args) {\n def encodedArgs = []\n args.each{ k,v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n LMDebugPrint(\"Querying ${url}...\", debug)\n\n def request\n if (proxyInfo.enabled) {\n request = url.toURL().openConnection(proxyInfo.proxy)\n }\n else {\n request = url.toURL().openConnection()\n }\n request.setRequestMethod(\"GET\")\n request.setDoOutput(true)\n headers.each{ k,v ->\n request.addRequestProperty(k, v)\n }\n\n return request\n}\n\n\n/* Generate auth for API calls. */\nstatic String generateAuth(id, key, path) {\n Long epoch_time = System.currentTimeMillis()\n Mac hmac = Mac.getInstance(\"HmacSHA256\")\n hmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA256\"))\n def signature = Hex.encodeHexString(hmac.doFinal(\"GET${epoch_time}${path}\".getBytes())).bytes.encodeBase64()\n \n return \"LMv1 ${id}:${signature}:${epoch_time}\"\n}\n\n\n/* Helper method to remind the collector this device is not dead */\ndef keepAlive(hostProps) {\n // Update the liveHost set so tell the collector we are happy.\n hostId = hostProps.get(\"system.deviceId\").toInteger()\n liveHostSet = LiveHostSet.getInstance()\n liveHostSet.flag(hostId)\n}\n\n\n/* Print results for JSON object of resource type */\ndef deviceResults(JSON, wildvalue) {\n // Print values specific to cloud resources\n // 1 indicates that the instance is running, 2 indicates that the instance is stopped and 3 the instance is terminated\n if (wildvalue == 2) {\n println \"${wildvalue}.cloudRunning=${JSON.findAll { it.awsState == 1 }.size()}\"\n println \"${wildvalue}.cloudStopped=${JSON.findAll { it.awsState == 2 }.size()}\"\n println \"${wildvalue}.cloudTerminated=${JSON.findAll { it.awsState == 3 }.size()}\"\n }\n else if (wildvalue == 4) {\n println \"${wildvalue}.cloudRunning=${JSON.findAll { it.azureState == 1 }.size()}\"\n println \"${wildvalue}.cloudStopped=${JSON.findAll { it.azureState == 2 }.size()}\"\n println \"${wildvalue}.cloudTerminated=${JSON.findAll { it.azureState == 3 }.size()}\"\n }\n else if (wildvalue == 7) {\n println \"${wildvalue}.cloudRunning=${JSON.findAll { it.gcpState == 1 }.size()}\"\n println \"${wildvalue}.cloudStopped=${JSON.findAll { it.gcpState == 2 }.size()}\"\n println \"${wildvalue}.cloudTerminated=${JSON.findAll { it.gcpState == 3 }.size()}\"\n }\n else if (wildvalue == 10) {\n def cloudRunning = JSON.findAll { (it.awsState == 1) || (it.azureState == 1) || (it.gcpState == 1) }.size()\n def cloudStopped = JSON.findAll { (it.awsState == 2) || (it.azureState == 2) || (it.gcpState == 2) }.size()\n def cloudTerminated = JSON.findAll { (it.awsState == 3) || (it.azureState == 3) || (it.gcpState == 3) }.size()\n\n println \"${wildvalue}.cloudRunning=${cloudRunning}\"\n println \"${wildvalue}.cloudStopped=${cloudStopped}\"\n println \"${wildvalue}.cloudTerminated=${cloudTerminated}\"\n }\n // If not a cloud device, print 0\n else {\n println \"${wildvalue}.cloudRunning=0\"\n println \"${wildvalue}.cloudStopped=0\"\n println \"${wildvalue}.cloudTerminated=0\"\n }\n // Print all other values\n if (JSON.size() > 0) {\n println \"${wildvalue}.totalResources=${JSON.size()}\"\n println \"${wildvalue}.aliveResources=${JSON.findAll { it.hostStatus == \"normal\" }.size()}\"\n println \"${wildvalue}.deadResources=${JSON.findAll { it.hostStatus == \"dead\" }.size() + JSON.findAll { it.hostStatus == \"dead-collector\" }.size()}\"\n println \"${wildvalue}.sdtResources=${JSON.findAll { it.sdtStatus.contains(\"SDT\") }.size()}\"\n println \"${wildvalue}.netflowResources=${JSON.findAll { it.enableNetflow }.size()}\"\n println \"${wildvalue}.alertsDisabled=${JSON.findAll { it.disableAlerting }.size()}\"\n println \"${wildvalue}.inAlertCritical=${JSON.findAll { it.alertStatus.contains(\"critical\") }.size()}\"\n println \"${wildvalue}.inAlertError=${JSON.findAll { it.alertStatus.contains(\"error\") }.size()}\"\n println \"${wildvalue}.inAlertWarn=${JSON.findAll { it.alertStatus.contains(\"warn\") }.size()}\"\n }\n // If no resources found for this device type, print all 0s\n else {\n println \"${wildvalue}.totalResources=0\"\n println \"${wildvalue}.aliveResources=0\"\n println \"${wildvalue}.deadResources=0\"\n println \"${wildvalue}.sdtResources=0\"\n println \"${wildvalue}.netflowResources=0\"\n println \"${wildvalue}.alertsDisabled=0\"\n println \"${wildvalue}.inAlertCritical=0\"\n println \"${wildvalue}.inAlertError=0\"\n println \"${wildvalue}.inAlertWarn=0\"\n }\n}"}, "datapoints": [{"name": "alertsDisabled", "description": "Count of resources with alerting disabled for specified device type.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.alertsDisabled", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "aliveResources", "description": "Count of alive resources for specified device type.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.aliveResources", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cloudOnly", "description": "Count of cloud instances that are only monitored by a cloud collector.\n\nNote: the value will be 0 for non-cloud devices.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cloudOnly", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cloudRunning", "description": "Count of cloud instances running for specified device type.\n\nNote: the value will be 0 for non-cloud devices.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cloudRunning", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cloudStopped", "description": "Count of cloud instances stopped for specified device type.\n\nNote: the value will be 0 for non-cloud devices.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cloudStopped", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cloudTerminated", "description": "Count of cloud instances terminated for specified device type.\n\nNote: the value will be 0 for non-cloud devices.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cloudTerminated", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "deadResources", "description": "Count of dead resources for specified device type.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.deadResources", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "inAlertCritical", "description": "Count of resources with one or more critical alerts for specified device type.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.inAlertCritical", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "inAlertError", "description": "Count of resources with one or more error alerts for specified device type.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.inAlertError", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "inAlertWarn", "description": "Count of resources with one or more warning alerts for specified device type.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.inAlertWarn", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "netflowResources", "description": "Count of resources with Netflow enabled for specified device type.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.netflowResources", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sdtResources", "description": "Count of resources in SDT for specified device type.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sdtResources", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "totalResources", "description": "Total count of resources for specified device type.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totalResources", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Alert Status Counts", "title": "Alert Status Counts", "verticalLabel": "count", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "inAlertCritical", "datapointName": "inAlertCritical", "consolidationFn": "max"}, {"name": "inAlertError", "datapointName": "inAlertError", "consolidationFn": "max"}, {"name": "inAlertWarn", "datapointName": "inAlertWarn", "consolidationFn": "max"}, {"name": "totalResources", "datapointName": "totalResources", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "noAlert", "expr": "totalResources - inAlertCritical - inAlertError - inAlertWarn"}], "lines": [{"type": "stack", "legend": "Critical", "color": "red", "datapointName": "inAlertCritical", "isVirtual": false}, {"type": "stack", "legend": "Error", "color": "orange2", "datapointName": "inAlertError", "isVirtual": false}, {"type": "stack", "legend": "Warn", "color": "yellow", "datapointName": "inAlertWarn", "isVirtual": false}, {"type": "stack", "legend": "No alerts", "color": "olive", "datapointName": "noAlert", "isVirtual": true}, {"type": "line", "legend": "Total resources", "color": "black", "datapointName": "totalResources", "isVirtual": false}]}, {"name": "Cloud Resource State", "title": "Cloud Resource State", "verticalLabel": "count", "min": 0.0, "displayPriority": 100, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cloudOnly", "datapointName": "cloudOnly", "consolidationFn": "max"}, {"name": "cloudRunning", "datapointName": "cloudRunning", "consolidationFn": "max"}, {"name": "cloudStopped", "datapointName": "cloudStopped", "consolidationFn": "max"}, {"name": "cloudTerminated", "datapointName": "cloudTerminated", "consolidationFn": "max"}, {"name": "totalResources", "datapointName": "totalResources", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Cloud only", "color": "navy", "datapointName": "cloudOnly", "isVirtual": false}, {"type": "stack", "legend": "Running", "color": "olive", "datapointName": "cloudRunning", "isVirtual": false}, {"type": "stack", "legend": "Stopped", "color": "orange2", "datapointName": "cloudStopped", "isVirtual": false}, {"type": "stack", "legend": "Terminated", "color": "red", "datapointName": "cloudTerminated", "isVirtual": false}, {"type": "line", "legend": "Total instances", "color": "black", "datapointName": "totalResources", "isVirtual": false}]}, {"name": "Netflow Resource Count", "title": "Netflow Resource Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "netflowResources", "datapointName": "netflowResources", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "netflowResources", "color": "fuchsia", "datapointName": "netflowResources", "isVirtual": false}]}, {"name": "Resources in SDT", "title": "Resources in SDT", "verticalLabel": "count", "min": 0.0, "displayPriority": 40, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "sdtResources", "datapointName": "sdtResources", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "sdtResources", "color": "blue", "datapointName": "sdtResources", "isVirtual": false}]}, {"name": "Total Resource Count", "title": "Total Resource Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "aliveResources", "datapointName": "aliveResources", "consolidationFn": "max"}, {"name": "deadResources", "datapointName": "deadResources", "consolidationFn": "max"}, {"name": "totalResources", "datapointName": "totalResources", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "Alive", "color": "olive", "datapointName": "aliveResources", "isVirtual": false}, {"type": "stack", "legend": "Dead", "color": "red", "datapointName": "deadResources", "isVirtual": false}, {"type": "line", "legend": "Total resources", "color": "black", "datapointName": "totalResources", "isVirtual": false}]}], "overviewGraphs": [{"name": "Dead Resources by Device Type", "title": "Dead Resources by Device Type", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "deadResources", "datapointName": "deadResources", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "stack", "legend": "Dead ##INSTANCE##", "color": "silver", "datapointName": "deadResources", "isVirtual": false}]}, {"name": "Total Resources by Device Type", "title": "Total Resources by Device Type", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "totalResources", "datapointName": "totalResources", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "stack", "legend": "Total ##INSTANCE##", "color": "silver", "datapointName": "totalResources", "isVirtual": false}]}]}

×DataSource: LogicMonitor_Portal_Users (859)

{"name": "LogicMonitor_Portal_Users", "description": "Monitor user counts on a LogicMonitor account.", "appliesTo": "hasCategory(\"LogicMonitorPortal\") && system.displayname =~ \".logicmonitor.com\"", "searchKeywords": "logicmonitor,portal metrics,api", "technicalNotes": "This module requires the \"addCategory_LogicMonitorPortal\" PropertySource to be installed, a device with a hostname and displayname including \"logicmonitor.com\", and the following properties configured:\n\nlmaccess.id - API Token ID\nlmaccess.key - API Token key\nlmaccount - (optional) Name of your LM account. This will default to whatever account this is running on.", "displayedAs": "LogicMonitor Users", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.live.LiveHostSet\nimport org.apache.commons.codec.binary.Hex\nimport javax.crypto.Mac\nimport javax.crypto.spec.SecretKeySpec\nimport java.security.MessageDigest\n\n\nString apiId = hostProps.get(\"lmaccess.id\")?:hostProps.get(\"logicmonitor.access.id\")\nString apiKey = hostProps.get(\"lmaccess.key\")?:hostProps.get(\"logicmonitor.access.key\")\ndef portalName = hostProps.get(\"lmaccount\")?:Settings.getSetting(Settings.AGENT_COMPANY)\ndef collectorProxy = Settings.getSetting(\"proxy.enable\").toBoolean()\nMap proxyInfo = [:]\n\nif (collectorProxy) {\n proxyInfo = [\n enabled : true,\n host : Settings.getSetting(\"proxy.host\"),\n port : Settings.getSetting(\"proxy.port\"),\n user : Settings.getSetting(\"proxy.user\"),\n pass : Settings.getSetting(\"proxy.pass\")\n ]\n\n proxyInfo[\"proxy\"] = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo.host, proxyInfo.port.toInteger()))\n}\n\ndef users = apiGetManyV2(portalName, apiId, apiKey, \"/setting/admins\", proxyInfo, ['size':1000])\ndef userSummary = apiGetV2(portalName, apiId, apiKey, \"/metrics/summary\", proxyInfo, null)\n\nuserResults(users)\nprintln \"userRoles=${userSummary[\"numberOfUserRoles\"]}\"\nprintln \"sessionUsers=${userSummary[\"numberOfSessionUsers\"]}\"\n\n// If script gets to this point, collector should consider this device alive\nkeepAlive(hostProps)\n\nreturn 0\n\n\n/* Paginated GET method. Returns a list of objects. */\nList apiGetManyV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n\n def pageSize = args.get('size', 1000) // Default the page size to 1000 if not specified.\n List items = []\n\n args['size'] = pageSize\n\n def pageCount = 0\n while (true) {\n pageCount += 1\n\n // Updated the args\n args['size'] = pageSize\n args['offset'] = items.size()\n\n def response = apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (response.get(\"errmsg\", \"OK\") != \"OK\") {\n throw new Exception(\"Santaba returned errormsg: ${payload?.errmsg}\")\n }\n items.addAll(response.items)\n\n // If we recieved less than we asked for it means we are done\n if (response.items.size() < pageSize) break\n }\n return items\n}\n\n\n/* Simple GET, returns a parsed json payload. No processing. */\ndef apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def request = rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (request.getResponseCode() == 200) {\n def payload = new JsonSlurper().parseText(request.content.text)\n return payload\n }\n else {\n throw new Exception(\"Server return HTTP code ${request.getResponseCode()}\")\n }\n}\n\n\n/* Raw GET method. */\ndef rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def auth = generateAuth(apiId, apiKey, endPoint)\n def headers = [\"Authorization\": auth, \"Content-Type\": \"application/json\", \"X-Version\":\"2\", \"External-User\":\"true\"]\n def url = \"https://${portalName}.logicmonitor.com/santaba/rest${endPoint}\"\n\n if (args) {\n def encodedArgs = []\n args.each{ k,v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n\n def request\n if (proxyInfo.enabled) {\n request = url.toURL().openConnection(proxyInfo.proxy)\n }\n else {\n request = url.toURL().openConnection()\n }\n request.setRequestMethod(\"GET\")\n request.setDoOutput(true)\n headers.each{ k,v ->\n request.addRequestProperty(k, v)\n }\n\n return request\n}\n\n\n/* Generate auth for API calls. */\nstatic String generateAuth(id, key, path) {\n Long epoch_time = System.currentTimeMillis()\n Mac hmac = Mac.getInstance(\"HmacSHA256\")\n hmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA256\"))\n def signature = Hex.encodeHexString(hmac.doFinal(\"GET${epoch_time}${path}\".getBytes())).bytes.encodeBase64()\n\n return \"LMv1 ${id}:${signature}:${epoch_time}\"\n}\n\n\n/* Helper method to remind the collector this device is not dead */\ndef keepAlive(hostProps) {\n // Update the liveHost set so tell the collector we are happy.\n hostId = hostProps.get(\"system.deviceId\").toInteger()\n def liveHostSet = LiveHostSet.getInstance()\n liveHostSet.flag(hostId)\n}\n\n\n/* Print results for JSON object. */\ndef userResults(JSON) {\n if (JSON.size() > 0) {\n println \"totalUsers=${JSON.size()}\"\n println \"twoFAEnabled=${JSON.findAll { it.twoFAEnabled }.size()}\"\n println \"apiOnly=${JSON.findAll { it.apionly }.size()}\"\n println \"apiAccessUsers=${JSON.findAll { it.apiTokens.size() > 0 }.size()}\"\n println \"activeUsers=${JSON.findAll { it.status == \"active\" }.size()}\"\n println \"recentUsers=${JSON.findAll { ((System.currentTimeMillis() / 1000) - it.lastLoginOn) < 604800 }?.size()}\"\n }\n else {\n println \"totalUsers=0\"\n println \"twoFAEnabled=0\"\n println \"apiOnlyUsers=0\"\n println \"apiAccessUsers=0\"\n println \"activeUsers=0\"\n println \"recentUsers=0\"\n }\n}"}, "datapoints": [{"name": "activeUsers", "description": "Count of active users in account.", "interpretMethod": "namevalue", "interpretExpr": "activeUsers", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "apiAccessUsers", "description": "Count of users with API access (includes API only).", "interpretMethod": "namevalue", "interpretExpr": "apiAccessUsers", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "apiOnly", "description": "Count of API only users.", "interpretMethod": "namevalue", "interpretExpr": "apiOnly", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "recentUsers", "description": "Count of users who have logged into the account in the last 7 days.", "interpretMethod": "namevalue", "interpretExpr": "recentUsers", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sessionUsers", "description": "Count of all users currently accessing the portal via the UI.", "interpretMethod": "namevalue", "interpretExpr": "sessionUsers", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "totalUsers", "description": "Total numbers of users in account.", "interpretMethod": "namevalue", "interpretExpr": "totalUsers", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "twoFAEnabled", "description": "Count of users with two factor authentication enabled.", "interpretMethod": "namevalue", "interpretExpr": "twoFAEnabled", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "userRoles", "description": "Count of saved user roles in account.", "interpretMethod": "namevalue", "interpretExpr": "userRoles", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "2FA Enabled Users", "title": "2FA Enabled Users", "verticalLabel": "count", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "totalUsers", "datapointName": "totalUsers", "consolidationFn": "max"}, {"name": "twoFAEnabled", "datapointName": "twoFAEnabled", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "no2FA", "expr": "totalUsers - twoFAEnabled"}], "lines": [{"type": "stack", "legend": "Users without two-factor authentication", "color": "red", "datapointName": "no2FA", "isVirtual": true}, {"type": "line", "legend": "Total users", "color": "black", "datapointName": "totalUsers", "isVirtual": false}, {"type": "stack", "legend": "Users with two-factor authentication enabled", "color": "olive", "datapointName": "twoFAEnabled", "isVirtual": false}]}, {"name": "API Users", "title": "API Users", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "apiAccessUsers", "datapointName": "apiAccessUsers", "consolidationFn": "max"}, {"name": "apiOnly", "datapointName": "apiOnly", "consolidationFn": "max"}, {"name": "totalUsers", "datapointName": "totalUsers", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "noAPI", "expr": "totalUsers - apiAccessUsers"}], "lines": [{"type": "stack", "legend": "Users with API access", "color": "olive", "datapointName": "apiAccessUsers", "isVirtual": false}, {"type": "line", "legend": "API only accounts", "color": "navy", "datapointName": "apiOnly", "isVirtual": false}, {"type": "stack", "legend": "Users without API access", "color": "yellow", "datapointName": "noAPI", "isVirtual": true}, {"type": "line", "legend": "Total users", "color": "black", "datapointName": "totalUsers", "isVirtual": false}]}, {"name": "Active Users", "title": "Active Users", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "activeUsers", "datapointName": "activeUsers", "consolidationFn": "max"}, {"name": "recentUsers", "datapointName": "recentUsers", "consolidationFn": "max"}, {"name": "sessionUsers", "datapointName": "sessionUsers", "consolidationFn": "max"}, {"name": "totalUsers", "datapointName": "totalUsers", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "inactiveUsers", "expr": "totalUsers - activeUsers"}], "lines": [{"type": "stack", "legend": "Active users", "color": "olive", "datapointName": "activeUsers", "isVirtual": false}, {"type": "stack", "legend": "Inactive users", "color": "red", "datapointName": "inactiveUsers", "isVirtual": true}, {"type": "line", "legend": "Recent users", "color": "navy", "datapointName": "recentUsers", "isVirtual": false}, {"type": "line", "legend": "Session users", "color": "yellow", "datapointName": "sessionUsers", "isVirtual": false}, {"type": "line", "legend": "Total users", "color": "black", "datapointName": "totalUsers", "isVirtual": false}]}, {"name": "User Roles", "title": "User Roles", "verticalLabel": "count", "min": 0.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "userRoles", "datapointName": "userRoles", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "User roles", "color": "fuchsia", "datapointName": "userRoles", "isVirtual": false}]}]}

×DataSource: LogicMonitor_Portal_Websites (858)

{"name": "LogicMonitor_Portal_Websites", "description": "Monitor websites on a LogicMonitor account.", "appliesTo": "hasCategory(\"LogicMonitorPortal\") && system.displayname =~ \".logicmonitor.com\"", "searchKeywords": "logicmonitor,portal metrics,api", "technicalNotes": "This module requires the \"addCategory_LogicMonitorPortal\" PropertySource to be installed, a device with a hostname and displayname including \"logicmonitor.com\", and the following properties configured:\n\nlmaccess.id - API Token ID\nlmaccess.key - API Token key\nlmaccount - (optional) Name of your LM account. This will default to whatever account this is running on.", "displayedAs": "LogicMonitor Websites", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.live.LiveHostSet\nimport org.apache.commons.codec.binary.Hex\nimport javax.crypto.Mac\nimport javax.crypto.spec.SecretKeySpec\nimport java.security.MessageDigest\n\n\nString apiId = hostProps.get(\"lmaccess.id\")?:hostProps.get(\"logicmonitor.access.id\")\nString apiKey = hostProps.get(\"lmaccess.key\")?:hostProps.get(\"logicmonitor.access.key\")\ndef portalName = hostProps.get(\"lmaccount\")?:Settings.getSetting(Settings.AGENT_COMPANY)\ndef collectorProxy = Settings.getSetting(\"proxy.enable\").toBoolean()\nMap proxyInfo = [:]\n\nif (collectorProxy) {\n proxyInfo = [\n enabled : true,\n host : Settings.getSetting(\"proxy.host\"),\n port : Settings.getSetting(\"proxy.port\"),\n user : Settings.getSetting(\"proxy.user\"),\n pass : Settings.getSetting(\"proxy.pass\")\n ]\n\n proxyInfo[\"proxy\"] = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo.host, proxyInfo.port.toInteger()))\n}\n\ndef websites = apiGetManyV2(portalName, apiId, apiKey, \"/website/websites\", proxyInfo, ['size':1000])\n\nwebsiteResults(websites)\n\n// If script gets to this point, collector should consider this device alive\nkeepAlive(hostProps)\n\nreturn 0\n\n\n/* Paginated GET method. Returns a list of objects. */\nList apiGetManyV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n\n def pageSize = args.get('size', 1000) // Default the page size to 1000 if not specified.\n List items = []\n\n args['size'] = pageSize\n\n def pageCount = 0\n while (true) {\n pageCount += 1\n\n // Updated the args\n args['size'] = pageSize\n args['offset'] = items.size()\n\n def response = apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (response.get(\"errmsg\", \"OK\") != \"OK\") {\n throw new Exception(\"Santaba returned errormsg: ${payload?.errmsg}\")\n }\n items.addAll(response.items)\n\n // If we recieved less than we asked for it means we are done\n if (response.items.size() < pageSize) break\n }\n return items\n}\n\n\n/* Simple GET, returns a parsed json payload. No processing. */\ndef apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def request = rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (request.getResponseCode() == 200) {\n def payload = new JsonSlurper().parseText(request.content.text)\n return payload\n }\n else {\n throw new Exception(\"Server return HTTP code ${request.getResponseCode()}\")\n }\n}\n\n\n/* Raw GET method. */\ndef rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def auth = generateAuth(apiId, apiKey, endPoint)\n def headers = [\"Authorization\": auth, \"Content-Type\": \"application/json\", \"X-Version\":\"2\", \"External-User\":\"true\"]\n def url = \"https://${portalName}.logicmonitor.com/santaba/rest${endPoint}\"\n\n if (args) {\n def encodedArgs = []\n args.each{ k,v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n\n def request\n if (proxyInfo.enabled) {\n request = url.toURL().openConnection(proxyInfo.proxy)\n }\n else {\n request = url.toURL().openConnection()\n }\n request.setRequestMethod(\"GET\")\n request.setDoOutput(true)\n headers.each{ k,v ->\n request.addRequestProperty(k, v)\n }\n\n return request\n}\n\n\n/* Generate auth for API calls. */\nstatic String generateAuth(id, key, path) {\n Long epoch_time = System.currentTimeMillis()\n Mac hmac = Mac.getInstance(\"HmacSHA256\")\n hmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA256\"))\n def signature = Hex.encodeHexString(hmac.doFinal(\"GET${epoch_time}${path}\".getBytes())).bytes.encodeBase64()\n\n return \"LMv1 ${id}:${signature}:${epoch_time}\"\n}\n\n\n/* Helper method to remind the collector this device is not dead */\ndef keepAlive(hostProps) {\n // Update the liveHost set so tell the collector we are happy.\n hostId = hostProps.get(\"system.deviceId\").toInteger()\n def liveHostSet = LiveHostSet.getInstance()\n liveHostSet.flag(hostId)\n}\n\n\n/* Print results for JSON object. */\ndef websiteResults(JSON) {\n if (JSON.size() > 0) {\n def totalWebsites = JSON.size()\n def aliveWebsites = JSON.findAll { it.status == \"alive\" }.size()\n println \"totalWebsites=${totalWebsites}\"\n println \"aliveWebsites=${aliveWebsites}\"\n println \"deadWebsites=${totalWebsites - aliveWebsites}\"\n println \"sdtWebsites=${JSON.findAll { it.status == \"active\" }.size()}\"\n println \"monitoringDisabled=${JSON.findAll { it.stopMonitoring }.size()}\"\n println \"alertsDisabled=${JSON.findAll { it.disableAlerting }.size()}\"\n println \"inAlertCritical=${JSON.findAll { it.alertStatus.contains(\"critical\") }.size()}\"\n println \"inAlertError=${JSON.findAll { it.alertStatus.contains(\"error\") }.size()}\"\n println \"inAlertWarn=${JSON.findAll { it.alertStatus.contains(\"warn\") }.size()}\"\n }\n else {\n println \"totalWebsites=0\"\n println \"aliveWebsites=0\"\n println \"deadWebsites=0\"\n println \"sdtWebsites=0\"\n println \"monitoringDisabled=0\"\n println \"alertsDisabled=0\"\n println \"inAlertCritical=0\"\n println \"inAlertError=0\"\n println \"inAlertWarn=0\"\n }\n}"}, "datapoints": [{"name": "alertsDisabled", "description": "Count of websites in account with alerting disabled.", "interpretMethod": "namevalue", "interpretExpr": "alertsDisabled", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "aliveWebsites", "description": "Count of alive websites in account.", "interpretMethod": "namevalue", "interpretExpr": "aliveWebsites", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "deadWebsites", "description": "Count of dead websites in account.", "interpretMethod": "namevalue", "interpretExpr": "deadWebsites", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "inAlertCritical", "description": "Count of websites with one or more critical alerts.", "interpretMethod": "namevalue", "interpretExpr": "inAlertCritical", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "inAlertError", "description": "Count of websites with one or more error alerts.", "interpretMethod": "namevalue", "interpretExpr": "inAlertError", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "inAlertWarn", "description": "Count of websites with one or more warning alerts.", "interpretMethod": "namevalue", "interpretExpr": "inAlertWarn", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "monitoringDisabled", "description": "Count of websites in account with monitoring disabled.", "interpretMethod": "namevalue", "interpretExpr": "monitoringDisabled", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sdtWebsites", "description": "Count of websites in SDT in account.", "interpretMethod": "namevalue", "interpretExpr": "sdtWebsites", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "totalWebsites", "description": "Total numbers of websites in account.", "interpretMethod": "namevalue", "interpretExpr": "totalWebsites", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Alert Status Counts", "title": "Alert Status Counts", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "inAlertCritical", "datapointName": "inAlertCritical", "consolidationFn": "max"}, {"name": "inAlertError", "datapointName": "inAlertError", "consolidationFn": "max"}, {"name": "inAlertWarn", "datapointName": "inAlertWarn", "consolidationFn": "max"}, {"name": "totalWebsites", "datapointName": "totalWebsites", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "noAlert", "expr": "totalWebsites - inAlertCritical - inAlertError - inAlertWarn"}], "lines": [{"type": "stack", "legend": "Critical", "color": "red", "datapointName": "inAlertCritical", "isVirtual": false}, {"type": "stack", "legend": "Error", "color": "orange2", "datapointName": "inAlertError", "isVirtual": false}, {"type": "stack", "legend": "Warn", "color": "yellow", "datapointName": "inAlertWarn", "isVirtual": false}, {"type": "stack", "legend": "No alerts", "color": "olive", "datapointName": "noAlert", "isVirtual": true}, {"type": "line", "legend": "Total websites", "color": "black", "datapointName": "totalWebsites", "isVirtual": false}]}, {"name": "Total Website Count", "title": "Total Website Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "aliveWebsites", "datapointName": "aliveWebsites", "consolidationFn": "max"}, {"name": "deadWebsites", "datapointName": "deadWebsites", "consolidationFn": "max"}, {"name": "totalWebsites", "datapointName": "totalWebsites", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "Alive websites", "color": "olive", "datapointName": "aliveWebsites", "isVirtual": false}, {"type": "stack", "legend": "Dead websites", "color": "red", "datapointName": "deadWebsites", "isVirtual": false}, {"type": "line", "legend": "Total websites", "color": "black", "datapointName": "totalWebsites", "isVirtual": false}]}, {"name": "Website States", "title": "Website States", "verticalLabel": "count", "min": 0.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "alertsDisabled", "datapointName": "alertsDisabled", "consolidationFn": "max"}, {"name": "monitoringDisabled", "datapointName": "monitoringDisabled", "consolidationFn": "max"}, {"name": "sdtWebsites", "datapointName": "sdtWebsites", "consolidationFn": "max"}, {"name": "totalWebsites", "datapointName": "totalWebsites", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Alerts disabled", "color": "red", "datapointName": "alertsDisabled", "isVirtual": false}, {"type": "line", "legend": "Monitoring disabled", "color": "yellow", "datapointName": "monitoringDisabled", "isVirtual": false}, {"type": "line", "legend": "In SDT", "color": "blue", "datapointName": "sdtWebsites", "isVirtual": false}, {"type": "line", "legend": "Total websites", "color": "black", "datapointName": "totalWebsites", "isVirtual": false}]}]}

×DataSource: Cisco_CPU_Usage (644)

{"name": "Cisco_CPU_Usage", "description": "Monitors Cisco CPU utilization over the last 1min and 5min time intervals.", "appliesTo": "hasCategory(\"CiscoCPU\") || hasCategory(\"CiscoASA\")", "searchKeywords": "usage,cpu,cisco,network", "technicalNotes": "- Setup appropriate instance level properties for SNMP configuration.\n- Replaces 'CiscoCPU-'.\n- Shows multiple instances with identical names.\n- Works on Cisco IOS Software releases 12.2(3.5) or later.", "displayedAs": "Cisco CPU", "collectionInterval": "1m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname')\ndef timeout = 40000 // 40 seconds\n\n// define maps\ndef entPhysicalName = Snmp.walkAsMap(host, \".1.3.6.1.2.1.47.1.1.1.1.7\", null, timeout)\ndef cpmCPUTotalPhysicalIndex = Snmp.walkAsMap(host, \".1.3.6.1.4.1.9.9.109.1.1.1.1.2\", null, timeout)\ndef cpuData = Snmp.walkAsMap(host, \".1.3.6.1.4.1.9.9.109.1.1.1.1.7\", null, timeout)\n\n// retrieve instances\ncpmCPUTotalPhysicalIndex.each { key, val ->\n if (cpuData.get(key) == null) return 0 // Avoid instances that won't have CPU data. Some CPU devices (ASA) have empty entries here.\n\n if (entPhysicalName[val]) {\n println \"${cpmCPUTotalPhysicalIndex[key]}##${entPhysicalName[val]} [Index:${cpmCPUTotalPhysicalIndex[key]}]\"\n }\n else if (entPhysicalName[key]) {\n println \"${cpmCPUTotalPhysicalIndex[key]}##${entPhysicalName[key]} [Index:${cpmCPUTotalPhysicalIndex[key]}]\"\n }\n else {\n println \"${cpmCPUTotalPhysicalIndex[key]}##CPU [Index:${cpmCPUTotalPhysicalIndex[key]}]\"\n }\n}\n\n// execution was successful, return 0\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.snmp.Snmp\n\ndef host = hostProps.get('system.hostname')\ndef timeout = 40000 // 40 seconds\n\ndpNames = [\n \"2\" : \"cpmCPUTotalPhysicalIndex\",\n \"7\" : \"CPU1min\",\n \"8\" : \"CPU5min\",\n \"13\": \"cpmCPUMemoryFree\",\n \"18\": \"cpmCPUMemoryFreeOvrflw\",\n \"19\": \"cpmCPUMemoryHCFree\", // 64 bit version\n \"12\": \"cpmCPUMemoryUsed\",\n \"16\": \"cpmCPUMemoryUsedOvrflw\",\n \"17\": \"cpmCPUMemoryHCUsed\", // 64 bit version\n]\n\n// First we retrieve all the CPU statistics.\ndef cpmCPUTotalEntry = Snmp.walkAsMap(host, \".1.3.6.1.4.1.9.9.109.1.1.1.1\", null, timeout)\n\n// Turn all of extracted entries into \"objects\" for further processing.\nMap<String, Map> snmpObjects = [:]\ncpmCPUTotalEntry.each{ index, value->\n String dpName = dpNames[index.tokenize(\".\")[0]]\n if (dpName) {\n index = index.tokenize(\".\")[1]\n Map entryObject = snmpObjects.get(index, [:])\n entryObject[dpName] = value\n }\n}\n\nsnmpObjects.each { index, entry ->\n\n if(entry.cpmCPUMemoryHCFree) { // Use 64 bit counters if we have them.\n entry.totalMemFree = entry.cpmCPUMemoryHCFree\n }\n else if (entry.cpmCPUMemoryFreeOvrflw != null && entry.cpmCPUMemoryFree != null) { // Fall back to 32 bit if the data is there.\n entry.totalMemFree = calcMem(entry.cpmCPUMemoryFreeOvrflw.toInteger(), entry.cpmCPUMemoryFree.toInteger())\n }\n else {\n entry.totalMemFree = entry.cpmCPUMemoryFree\n }\n\n if(entry.cpmCPUMemoryHCUsed) { // Use 64 bit counters if we have them\n entry.totalMemUsed= entry.cpmCPUMemoryHCUsed\n }\n else if (entry.cpmCPUMemoryUsedOvrflw != null && entry.cpmCPUMemoryUsed != null) { //Fall back to 32 bit if the data is there.\n entry.totalMemUsed = calcMem(entry.cpmCPUMemoryUsedOvrflw.toInteger(), entry.cpmCPUMemoryUsed.toInteger())\n }\n else {\n entry.totalMemUsed = entry.cpmCPUMemoryUsed\n }\n\n entry.each { k,v ->\n println \"${entry.cpmCPUTotalPhysicalIndex}.${k}=${v}\"\n }\n}\n\nreturn 0\n\n\ndef calcMem(Integer mem, Integer overFlow) {\n if (overFlow) {return overFlow << 32 | mem}\n else {return mem}\n}"}, "datapoints": [{"name": "CPU1min", "description": "The overall CPU busy percentage in the last one minute period.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CPU1min", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": "> 70 80 90", "noData": "Do not trigger an alert", "triggerInterval": 4, "clearInterval": 0, "alertBody": "##INSTANCE## on Cisco host ##HOST## is reporting sustained high CPU usage of ##VALUE##%, placing it into ##LEVEL## state.\n\nConsider running the command \"show processes cpu sorted\" on the host to identify which process may be causing the high cpu usage.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "CPU5min", "description": "The overall CPU busy percentage in the last five minute period.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CPU5min", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemoryFree", "description": "The overall CPU wide system memory which is currently free (in kilobytes).", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totalMemFree", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "MemoryTotal", "description": "The calculated sum of reported used and free memory (in kilobytes). Handles 64-bit version or 32-bit version with overflow accounted for.", "interpretMethod": "expression", "interpretExpr": "MemoryUsed+MemoryFree", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "MemoryUsed", "description": "The overall CPU wide system memory which is currently under use (in kilobytes). Handles 64-bit version or 32-bit version with overflow accounted for.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totalMemUsed", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}], "graphs": [{"name": "CPU Busy", "title": "CPU Busy", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CPU1min", "datapointName": "CPU1min", "consolidationFn": "average"}, {"name": "CPU5min", "datapointName": "CPU5min", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "CPU (1 min)", "color": "orange2", "datapointName": "CPU1min", "isVirtual": false}, {"type": "line", "legend": "CPU (5 min)", "color": "green", "datapointName": "CPU5min", "isVirtual": false}]}, {"name": "Memory Usage", "title": "Memory Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "5hour", "scale1024": true, "rigid": true, "datapoints": [{"name": "MemoryFree", "datapointName": "MemoryFree", "consolidationFn": "average"}, {"name": "MemoryTotal", "datapointName": "MemoryTotal", "consolidationFn": "average"}, {"name": "MemoryUsed", "datapointName": "MemoryUsed", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "FreeBytes", "expr": "MemoryFree*1024"}, {"name": "TotalBytes", "expr": "MemoryTotal*1024"}, {"name": "UsedBytes", "expr": "MemoryUsed*1024"}], "lines": [{"type": "stack", "legend": "Free", "color": "olive", "datapointName": "FreeBytes", "isVirtual": true}, {"type": "line", "legend": "Total", "color": "gray", "datapointName": "TotalBytes", "isVirtual": true}, {"type": "stack", "legend": "Used", "color": "red2", "datapointName": "UsedBytes", "isVirtual": true}]}], "overviewGraphs": [{"name": "Top 10 by CPU Busy Percentage - 1 min", "title": "Top 10 by CPU Busy Percentage - 1 min", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "CPU1min", "datapointName": "CPU1min", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "CPU1min", "isVirtual": false}]}, {"name": "Top 10 by CPU Busy Percentage - 5 min", "title": "Top 10 by CPU Busy Percentage - 5 min", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "CPU5min", "datapointName": "CPU5min", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "CPU5min", "isVirtual": false}]}, {"name": "Top 10 by Memory Used", "title": "Top 10 by Memory Used", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "MemoryUsed", "datapointName": "MemoryUsed", "consolidationFn": "average", "aggregateMethod": "max"}], "virtualDatapoints": [{"name": "MemUsedBytes", "expr": "MemoryUsed * 1024"}], "lines": [{"type": "line", "legend": "- ##INSTANCE##", "color": "silver", "datapointName": "MemUsedBytes", "isVirtual": true}]}]}

×DataSource: Microsoft_Windows_Cluster_Resources (941)

{"name": "Microsoft_Windows_Cluster_Resources", "description": "Failover Cluster Resources", "appliesTo": "hasCategory(\"WSFC_VNN\") || hasCategory(\"NLB_VNN\")", "searchKeywords": "cluster,cluster resources,windows", "technicalNotes": "Tested with Windows Server 2012 through 2019. \nRequires PropertySource addCategory_WindowsFailoverCluster and Powershell remote access.", "displayedAs": "Microsoft_Windows_Cluster_Resources", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = \"##SYSTEM.HOSTNAME##\".ToLower()\n$winRM = '##AUTO.WINRM##'.ToLower()\n$clusterName='##auto.wsfc.name##'\n## Debug flag\n$DEBUG = $false\n\n#$winRM will default to enabled since the property source that sets it isn't universal.\nif ($winRM -EQ '##auto.winrm##')\n {\n $winRM = 'enabled'\n }\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n\n# If the hostname is an IP address use the clustername for hostname\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\")\n{\n $hostname = $clusterName\n}\nif ($DEBUG) {\"--DEBUG-- Hostname: $hostname\"}\nif ($DEBUG) {\"--DEBUG-- PS Version: $( $PSVersionTable.PSVersion )\"}\nif ($DEBUG) {\"--DEBUG-- CollectorName $collectorName \"}\nif ($DEBUG) {\"--DEBUG-- winRM $winRM \"}\n\n## check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($HOSTNAME -like $COLLECTORNAME)\n{\n if ($DEBUG) { \"--DEBUG-- Hostname is equal Collector name\"}\n $session = New-PSSession\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($WMI_USER) -and [string]::IsNullOrWhiteSpace($WMI_PASS)) -or (($WMI_USER -like '*WMI.USER*') -and ($WMI_PASS -like '*WMI.PASS*') -and $winRM -eq 'enabled' ))\n{\n # no WMI password available. Use service name user and password\n if ($DEBUG) {\"--DEBUG-- Collector user being used.\"}\n $session = New-PSSession -ComputerName $hostname\n}\nelseif ($winRM -eq \"enabled\")\n{\n\n if ($DEBUG) { \"--DEBUG-- Remote Creds: Converting user/pass to credential string\"}\n # Use remote powershell with wmi.user and wmi.pass. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $WMI_PASS -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $WMI_USER, $remote_pass;\n $session = New-PSSession -Credential $remote_credential -ComputerName $hostname\n}\nelse\n{\n \"WinRM disabled and not a local collector\"\n exit 1\n}\n$clusterResources = Invoke-Command -Session $session -ScriptBlock { Get-ClusterResource -cluster $using:clusterName |Select-Object Name, OwnerNode, State, ResourceType }\n\n$regexA = '\\(|\\s|\\)|\\\\' \n\n\n# Check for the cluster IP addresses. If one of them is online then report the clusterIP as Online. If all are offline the report offline\n$ip = $clusterResources | select-object Name, State | Where-Object { $_.Name -like \"Cluster IP Address*\" -and $_.State -eq 2 } \nif ($ip){\n write-host \"Cluster_IP_Address##Cluster IP Address######auto.ClusterResourceType=IP Address\" \n}\n\n# Check for the SQL IP addresses. If one of them is online then report the clusterIP as Online. If all are offline the report offline\n$hasSql = $clusterResources | select-object Name, State | Where-Object { $_.Name -like \"SQL IP Address*\"} \n\nif ($hasSql){\n write-host \"SQL_IP_Address##SQL IP Address######auto.ClusterResourceType=IP Address\" \n}\n\n$allOtherResources = $clusterResources | select-object Name, State | Where-Object { $_.Name -notlike \"SQL IP Address*\" -and $_.Name -notlike \"Cluster IP Address*\" } \n\nforeach ($clusterResource in $allOtherResources)\n{\n $wildvalue = $clusterResource.Name -replace $regexA, \"_\"\n $wildalias = $clusterResource.Name \n $resourceType = $clusterResource.ResourceType\n $ownerNode = $clusterResource.OwnerNode\n Write-Host \"$wildvalue##$wildalias######auto.ClusterResourceOwnerNode=$ownerNode&auto.ClusterResourceType=$resourceType\" \n}\n\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\nif ($DEBUG) { \"--DEBUG-- Successful output\" }\nEXIT 0\n\n"}, "groupMethod": "ilp", "groupExpr": "auto.clusterresourcetype"}, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = \"##SYSTEM.HOSTNAME##\".ToLower()\n$winRM = '##AUTO.WINRM##'.ToLower()\n$clusterName='##auto.wsfc.name##'\n## Debug flag\n$DEBUG = $false\n\n#$winRM will default to enabled since the property source that sets it isn't universal.\nif ($winRM -EQ '##auto.winrm##')\n {\n $winRM = 'enabled'\n }\n\n$collectorName = [System.Net.Dns]::GetHostByName($env:computerName).HostName.tolower()\n\n\n# If the hostname is an IP address use the clustername for hostname\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\")\n{\n $hostname = $clusterName\n}\nif ($DEBUG) {\"--DEBUG-- Hostname: $hostname\"}\nif ($DEBUG) {\"--DEBUG-- PS Version: $( $PSVersionTable.PSVersion )\"}\nif ($DEBUG) {\"--DEBUG-- CollectorName $collectorName \"}\nif ($DEBUG) {\"--DEBUG-- winRM $winRM \"}\n\n## check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($HOSTNAME -like $COLLECTORNAME)\n{\n if ($DEBUG) { \"--DEBUG-- Hostname is equal Collector name\"}\n $session = New-PSSession\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($WMI_USER) -and [string]::IsNullOrWhiteSpace($WMI_PASS)) -or (($WMI_USER -like '*WMI.USER*') -and ($WMI_PASS -like '*WMI.PASS*') -and $winRM -eq 'enabled' ))\n{\n # no WMI password available. Use service name user and password\n if ($DEBUG) {\"--DEBUG-- Collector user being used.\"}\n $session = New-PSSession -ComputerName $hostname\n}\nelseif ($winRM -eq \"enabled\")\n{\n\n if ($DEBUG) { \"--DEBUG-- Remote Creds: Converting user/pass to credential string\"}\n # Use remote powershell with wmi.user and wmi.pass. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $WMI_PASS -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $WMI_USER, $remote_pass;\n $session = New-PSSession -Credential $remote_credential -ComputerName $hostname\n}\nelse\n{\n \"WinRM disabled and not a local collector\"\n exit 1\n}\n$clusterResources = Invoke-Command -Session $session -ScriptBlock { Get-ClusterResource -cluster $using:clusterName |Select-Object Name, OwnerNode, State, ResourceType }\n\n$regexA = '\\(|\\s|\\)|\\\\' \n\n\n# Check for the cluster IP addresses. If one of them is online then report the clusterIP as Online. If all are offline the report offline\n$ip = $clusterResources | select-object Name, State | Where-Object { $_.Name -like \"Cluster IP Address*\" -and $_.State -eq 2 } \nif ($ip){\n write-host \"Cluster_IP_Address.state=2\"\n}\nelse {\n write-host \"Cluster_IP_Address.state=3\"\n}\n\n# Check for the SQL IP addresses. If one of them is online then report the clusterIP as Online. If all are offline the report offline\n$hasSql = $clusterResources | select-object Name, State | Where-Object { $_.Name -like \"SQL IP Address*\"} \n$sqlIp = $clusterResources | select-object Name, State | Where-Object { $_.Name -like \"SQL IP Address*\" -and $_.State -eq 2 } \n\nif ($hasSql -and $sqlIp){\n write-host \"SQL_IP_Address.state=2\"\n}\nelseif ($hasSql){\n write-host \"SQL_IP_Address.state=3\"\n}\n\n$allOtherResources = $clusterResources | select-object Name, State | Where-Object { $_.Name -notlike \"SQL IP Address*\" -and $_.Name -notlike \"Cluster IP Address*\" } \nforeach ($clusterResource in $allOtherResources)\n{\n $wildvalue = $clusterResource.Name -replace $regexA, \"_\"\n $instanceState = $clusterResource.State\n write-host \"$wildvalue.state=$instanceState\"\n}\n\nGet-PSSession | Remove-PSSession -ErrorAction SilentlyContinue\nif ($DEBUG) { \"--DEBUG-- Successful output\" }\nEXIT 0"}, "datapoints": [{"name": "state", "description": "Current state of the resource.\n\nStatus Codes:\n-1=Unknown -The operation was not successful.\n0=Undefined.\n1=Initializing. \n2=Online\n3=Offline\n4=Failed\n128=Pending (coming online or going offline)\n129=Coming Online\n130=Going Offline", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.state", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "20", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Resource State", "title": "Resource State", "verticalLabel": "status code", "min": -1.0, "displayPriority": 10, "timeScale": "1month", "scale1024": false, "rigid": false, "datapoints": [{"name": "state", "datapointName": "state", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "state", "color": "silver", "datapointName": "state", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Resource State", "title": "Top 10 Resource State", "verticalLabel": "status code", "min": -1.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "state", "datapointName": "state", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE## State", "color": "silver", "datapointName": "state", "isVirtual": false}]}]}

×DataSource: PaloAlto_FW_GlobalProtectGateway_ConfigXML (2324)

{"name": "PaloAlto_FW_GlobalProtectGateway_ConfigXML", "description": "Captures Palo Alto firewall GlobalProtect gateway configuration in XML format", "appliesTo": "hasCategory(\"PaloAlto\") && paloalto.apikey.pass", "searchKeywords": "firewall,network,hardware,paloalto", "technicalNotes": "- https://www.logicmonitor.com/support/monitoring/networking-firewalls/palo-alto-firewalls", "displayedAs": "GlobalProtect Gateway Config (XML)", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef host = hostProps.get(\"system.hostname\")\ndef apikey = hostProps.get(\"paloalto.apikey.pass\")?.trim()\nif (apikey == null) {\n println \"No paloalto.apikey.pass set\"\n return 1\n}\n\ndef urlOutput\ndef command = URLEncoder.encode(\"<show><global-protect-gateway><gateway></gateway></global-protect-gateway></show>\", \"UTF-8\")\ndef url = \"https://${host}/api/?type=op&cmd=${command}&key=${apikey}\"\ndef getRequestConn = url.toURL().openConnection()\nif (getRequestConn.responseCode == 200) {\n urlOutput = getRequestConn.content.text\n} else {\n println \"Failed to GET <show><global-protect-gateway><gateway></gateway></global-protect-gateway></show>\\nStatus code: ${getRequestConn.responseCode}\"\n return 1\n}\n\n/** These lines filter out IPv4 and IPv6 ephemeral lines from \"ip-pool-next-ip\" and\n * \"ip-pool-next-ip-v6\" sections as these lines could change on every configuration\n * check and cause alerts. */\n\nfilteredOutput = urlOutput.replaceAll(/ \\W+<ip-pool-next-ip>(\\W+<member>\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}<\\/member>)*\\W+<\\/ip-pool-next-ip>/,\"\")\nfilteredIPsOutput = filteredOutput.replaceAll(/ \\W+<ip-pool-next-ip-v6>(\\W+<member>([a-fA-F0-9]{1,4}:+){1,7}[a-fA-F0-9]{1,4}<\\/member>)*\\W+<\\/ip-pool-next-ip-v6>/,\"\")\n\nprintln filteredIPsOutput\n\nreturn 0"}, "configChecks": [{"name": "DifferenceTest", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 0}, "severity": "warn"}, {"name": "RetrievalTest", "description": "", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: PaloAlto_FW_VPNGateway_ConfigXML (2323)

{"name": "PaloAlto_FW_VPNGateway_ConfigXML", "description": "Captures Palo Alto firewall VPN gateway configuration in XML format", "appliesTo": "hasCategory(\"PaloAlto\") && paloalto.apikey.pass", "searchKeywords": "firewall,network,hardware,paloalto", "technicalNotes": "- requires API key device property set as 'paloalto.apikey.pass'\n- xml format suitable for restoring from backup", "displayedAs": "VPN Gateway Config (XML)", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef host = hostProps.get(\"system.hostname\")\ndef apikey = hostProps.get(\"paloalto.apikey.pass\")?.trim()\nif (apikey == null) {\n println \"No paloalto.apikey.pass set\"\n return 1\n}\n\ndef urlOutput\ndef command = URLEncoder.encode(\"<show><vpn><gateway></gateway></vpn></show>\", \"UTF-8\")\ndef url = \"https://${host}/api/?type=op&cmd=${command}&key=${apikey}\"\ndef getRequestConn = url.toURL().openConnection()\nif (getRequestConn.responseCode == 200) {\n urlOutput = getRequestConn.content.text\n} else {\n println \"Failed to GET <show><vpn><gateway></gateway></vpn></show>\\nStatus code: ${getRequestConn.responseCode}\"\n return 1\n}\n\nprint urlOutput\n\nreturn 0"}, "configChecks": [{"name": "DifferenceTest", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 0}, "severity": "warn"}, {"name": "RetrievalTest", "description": "", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: PaloAlto_FW_VPNTunnel_ConfigXML (2322)

{"name": "PaloAlto_FW_VPNTunnel_ConfigXML", "description": "Captures Palo Alto firewall VPN tunnel configuration in XML format", "appliesTo": "hasCategory(\"PaloAlto\") && paloalto.apikey.pass", "searchKeywords": "firewall,network,hardware,paloalto", "technicalNotes": "- requires API key device property set as 'paloalto.apikey.pass'\n- xml format suitable for restoring from backup", "displayedAs": "VPN Tunnel Config (XML)", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 2, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef host = hostProps.get(\"system.hostname\")\ndef apikey = hostProps.get(\"paloalto.apikey.pass\")?.trim()\nif (apikey == null) {\n println \"No paloalto.apikey.pass set\"\n return 1\n}\n\ndef urlOutput\ndef command = URLEncoder.encode(\"<show><vpn><tunnel></tunnel></vpn></show>\", \"UTF-8\")\ndef url = \"https://${host}/api/?type=op&cmd=${command}&key=${apikey}\"\ndef getRequestConn = url.toURL().openConnection()\nif (getRequestConn.responseCode == 200) {\n urlOutput = getRequestConn.content.text\n} else {\n println \"Failed to GET <show><vpn><tunnel></tunnel></vpn></show>\\nStatus code: ${getRequestConn.responseCode}\"\n return 1\n}\n\nprint urlOutput\n\nreturn 0"}, "configChecks": [{"name": "DifferenceTest", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": [], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": false}, "clearAfterAck": true, "clearAfterMin": 0}, "severity": "warn"}, {"name": "RetrievalTest", "description": "", "type": "fetch", "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: PaloAlto_FW_Certificates (72)

{"name": "PaloAlto_FW_Certificates", "description": "Monitors Palo Alto certificate expiration.", "appliesTo": "hasCategory(\"PaloAlto\")", "searchKeywords": "firewall,network,paloalto", "technicalNotes": "- Requires property \"paloalto.apikey.pass\" set to API token \n- An alternative port can be specified using the optional property \"paloalto.port\"\n\nSupport Documentation: https://www.logicmonitor.com/support/monitoring/networking-firewalls/palo-alto-firewalls", "displayedAs": "Certificates", "collectionInterval": "20m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\ndef host = hostProps.get(\"system.hostname\")\ndef port = hostProps.get(\"paloalto.port\")?: 443\ndef apikey = hostProps.get(\"paloalto.apikey.pass\")?.trim()\nif (apikey == null) {\n println \"No paloalto.apikey.pass set\"\n return 1\n}\n\ndef response\ndef command = URLEncoder.encode(\"<show><config><running><xpath>shared/certificate</xpath></running></config></show>\", \"UTF-8\")\ndef url = \"https://${host}:${port}/api/?type=op&key=${apikey}&cmd=${command}\"\ndef getRequestConn1 = url.toURL().openConnection()\nif (getRequestConn1.responseCode == 200) {\n response = new XmlSlurper().parseText(getRequestConn1.content.text)\n} else {\n println \"Failed to GET <show><config><running><xpath>shared/certificate</xpath></running></config></show>\\nStatus code: ${getRequestConn1.responseCode}\"\n}\n\nif (response != null && response != \"No such node\") {\n response?.result?.certificate?.entry?.each { entry ->\n def instance_name = entry?.\"common-name\"?.text()\n def wildvalue = instance_name?.toString()?.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")\n def description = \"Issuer: \" + entry?.issuer?.text()\n println \"${wildvalue}##${instance_name}##${description}\"\n }\n} \n\n\n// Also check for other certs in sslmgr-store\ndef showResponse\ndef getRequestConn2\ntry {\n def commandSSLmgrStore = URLEncoder.encode(\"<show><sslmgr-store><config-certificate-info></config-certificate-info></sslmgr-store></show>\", \"UTF-8\")\n def urlSSLmgrStore = \"https://${host}:$port/api/?type=op&include-key=no&key=${apikey}&cmd=${commandSSLmgrStore}\"\n getRequestConn2 = urlSSLmgrStore.toURL().openConnection()\n if (getRequestConn2.responseCode == 200) {\n showResponse = new XmlSlurper().parseText(getRequestConn2.content.text)\n } else {\n println \"Failed to GET <show><sslmgr-store><config-certificate-info></config-certificate-info></sslmgr-store></show>\\nStatus code: ${getRequestConn2.responseCode}\"\n }\n} catch (Exception e) {}\n\nif (showResponse != null && showResponse != \"No such node\") {\n String certInfo = showResponse.result\n def recordParse = certInfo?.split(/\\n\\n/)\n Integer i = 0\n recordParse?.each { it ->\n def cnPrefix = \"/CN=\"\n \n def description = recordParse[i].find(/issuer.*\\n/)\n if (description.contains(cnPrefix)) description = description.substring(description.indexOf(cnPrefix) + cnPrefix.size())\n \n def instance_name = recordParse[i].find(/db-name.*\\n/)\n if (instance_name.contains(cnPrefix)) instance_name = instance_name.substring(instance_name.indexOf(cnPrefix) + cnPrefix.size())\n \n if (description == null || instance_name == null) return\n \n def wildvalue = instance_name?.toString()?.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")\n println wildvalue.toString().replace(\"\\n\", \"\") + \"##\" + instance_name.toString().replace(\"\\n\", \"\") + \"##\" + description.toString().replace(\"\\n\", \"\")\n i++\n } \n}\n\nif (getRequestConn1?.responseCode != 200 && getRequestConn2?.responseCode != 200) return 1\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.time.TimeCategory\nimport java.text.SimpleDateFormat\n\ndef host = hostProps.get(\"system.hostname\")\ndef port = hostProps.get(\"paloalto.port\")?: 443\ndef apikey = hostProps.get(\"paloalto.apikey.pass\")?.trim()\nif (apikey == null) {\n println \"No paloalto.apikey.pass set\"\n return 1\n}\n\ndef response\ndef command = URLEncoder.encode(\"<show><config><running><xpath>shared/certificate</xpath></running></config></show>\", \"UTF-8\")\ndef url = \"https://${host}:${port}/api/?type=op&key=${apikey}&cmd=${command}\"\ndef getRequestConn1 = url.toURL().openConnection()\nif (getRequestConn1.responseCode == 200) {\n response = new XmlSlurper().parseText(getRequestConn1.content.text)\n} else {\n println \"Failed to GET <show><config><running><xpath>shared/certificate</xpath></running></config></show>\\nStatus code: ${getRequestConn1.responseCode}\"\n}\n\ndef now = new Date()\nif (response != null && response != \"No such node\") {\n response?.result?.certificate?.entry?.each { entry ->\n def expiry = entry.\"expiry-epoch\"\n if (expiry != \"\") {\n def instance_name = entry?.\"common-name\"?.text()\n def wildvalue = instance_name?.toString()?.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")\n def expiration_epoch = ((expiry.toLong()) * 1000)\n def expiry_date = new Date(expiration_epoch)\n use(TimeCategory) {\n def duration = (expiry_date - now)\n println \"${wildvalue}.daysleft=\" + duration.days\n }\n }\n }\n}\n\n// Also check for other certs in sslmgr-store\ndef showResponse\ndef getRequestConn2\ntry {\n def commandSSLmgrStore = URLEncoder.encode(\"<show><sslmgr-store><config-certificate-info></config-certificate-info></sslmgr-store></show>\", \"UTF-8\")\n def urlSSLmgrStore = \"https://${host}:$port/api/?type=op&include-key=no&key=${apikey}&cmd=${commandSSLmgrStore}\"\n getRequestConn2 = urlSSLmgrStore.toURL().openConnection()\n if (getRequestConn2.responseCode == 200) {\n showResponse = new XmlSlurper().parseText(getRequestConn2.content.text)\n } else {\n println \"Failed to GET <show><sslmgr-store><config-certificate-info></config-certificate-info></sslmgr-store></show>\\nStatus code: ${getRequestConn2.responseCode}\"\n }\n\n if (showResponse != null && showResponse != \"No such node\") {\n String certInfo = showResponse.result\n def recordParse = certInfo?.split(/\\n\\n/)\n Integer i = 0\n recordParse?.each { it ->\n def cnPrefix = \"/CN=\"\n def instance_name = recordParse[i].find(/db-name.*\\n/)\n if (instance_name.contains(cnPrefix)) instance_name = instance_name.substring(instance_name.indexOf(cnPrefix) + cnPrefix.size())\n \n def wildvalue = instance_name?.toString()?.replaceAll(/[:|\\\\|\\s|=]+/, \"_\")\n def db_exp_date = recordParse[i].find(/ db-exp-date.*\\n/).split(/: /)\n def cleanExpDate = db_exp_date[1].toString().split(/Z\\(/)\n \n // Test for 2 digit year usage, the current default output\n if (cleanExpDate[0].length() == 12) {\n def newcleanExpDate = \"20\" + cleanExpDate[0] // append a leading 20 to the year. Needed because 2042 will be seen as 1942 if 2 digit year is used.\n def formatDate = new SimpleDateFormat(\"yyyyMMddkkmmss\").parse(newcleanExpDate)\n def expDuration = formatDate\n use(TimeCategory) {\n def showDuration = expDuration - now\n println wildvalue + \".daysleft=\" + showDuration.days\n }\n\n // If 4 digit years are used in the future do not append 20 to the year string and use what we are given as the date.\n } else if (cleanExpDate[0].length() == 14) {\n def formatDate = new SimpleDateFormat(\"yyyyMMddkkmmss\").parse(cleanExpDate[0])\n def expDuration = formatDate\n use(TimeCategory) {\n def showDuration = expDuration - now\n println wildvalue + \".daysleft=\" + showDuration.days\n }\n }\n i++\n }\n }\n} catch (Exception e) {}\n\nif (getRequestConn1?.responseCode != 200 && getRequestConn2?.responseCode != 200) return 1\n\nreturn 0"}, "datapoints": [{"name": "daysLeft", "description": "Number of days left before the certificate expires.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.daysleft", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "<= 60 30 15", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Palo Alto firewall ##HOST## is reporting that the ##INSTANCE## certificate has ##VALUE## days left before expiring, placing the license into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Days Till Expiration", "title": "Days Till Expiration", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "daysleft", "datapointName": "daysLeft", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Days Left", "color": "blue", "datapointName": "daysleft", "isVirtual": false}]}], "overviewGraphs": [{"name": "Days Till Expiration Overview", "title": "Days Till Expiration Overview", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "daysleft", "datapointName": "daysLeft", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "AUTO", "datapointName": "daysleft", "isVirtual": false}]}]}

×DataSource: LogicMonitor_Portal_DataSources (861)

{"name": "LogicMonitor_Portal_DataSources", "description": "Monitor instance counts across devices on individual DataSources within a LogicMonitor account as well as active alerts, datapoints, and alerts defined.", "appliesTo": "hasCategory(\"LogicMonitorPortal\") && system.displayname =~ \".logicmonitor.com\"", "searchKeywords": "logicmonitor,portal metrics,api", "technicalNotes": "This module requires the \"addCategory_LogicMonitorPortal\" PropertySource to be installed, a device with a hostname and displayname including \"logicmonitor.com\", and the following properties configured:\n\nlmaccess.id - API Token ID\nlmaccess.key - API Token key\nlmaccount - (optional) Name of your LM account. This will default to whatever account this is running on.", "displayedAs": "LogicMonitor DataSources", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.live.LiveHostSet\nimport org.apache.commons.codec.binary.Hex\nimport javax.crypto.Mac\nimport javax.crypto.spec.SecretKeySpec\nimport java.security.MessageDigest\n\n\nString apiId = hostProps.get(\"lmaccess.id\")?:hostProps.get(\"logicmonitor.access.id\")\nString apiKey = hostProps.get(\"lmaccess.key\")?:hostProps.get(\"logicmonitor.access.key\")\ndef portalName = hostProps.get(\"lmaccount\")?:Settings.getSetting(Settings.AGENT_COMPANY)\ndef collectorProxy = Settings.getSetting(\"proxy.enable\").toBoolean()\nMap proxyInfo = [:]\n\nif (collectorProxy) {\n proxyInfo = [\n enabled : true,\n host : Settings.getSetting(\"proxy.host\"),\n port : Settings.getSetting(\"proxy.port\"),\n user : Settings.getSetting(\"proxy.user\"),\n pass : Settings.getSetting(\"proxy.pass\")\n ]\n\n proxyInfo[\"proxy\"] = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo.host, proxyInfo.port.toInteger()))\n}\n\ndef dsDefinitions = [:]\n\napiGetManyV2(portalName, apiId, apiKey, \"/setting/datasources\", proxyInfo, [fields:'id,name,group']).each { ds->\n dsDefinitions[ds.name] = ds\n}\n\ndef dsInstances = apiGetV2(portalName, apiId, apiKey, \"/metrics/summary\", proxyInfo)\n\ndsInstances.numberOfInstancesPerDS.each{ dsName,v ->\n def ds = dsDefinitions.get(dsName,[:])\n def wildvalue = dsName.replaceAll(/[.#\\\\:= ]/,'_')\n\n def ilp = [:]\n if(ds.group) ilp['ds.group'] = ds.group\n\n println \"${wildvalue}##${dsName}######${ilp.collect {\"${it.key}=${URLEncoder.encode(it.value)}\"}.join(\"&\")}\"\n}\n\n// If script gets to this point, collector should consider this device alive\nkeepAlive(hostProps)\n\nreturn 0\n\n/* Paginated GET method. Returns a list of objects. */\nList apiGetManyV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n\n def pageSize = args.get('size', 1000) // Default the page size to 1000 if not specified.\n List items = []\n\n args['size'] = pageSize\n\n def pageCount = 0\n while (true) {\n pageCount += 1\n\n // Updated the args\n args['size'] = pageSize\n args['offset'] = items.size()\n\n def response = apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (response.get(\"errmsg\", \"OK\") != \"OK\") {\n throw new Exception(\"Santaba returned errormsg: ${payload?.errmsg}\")\n }\n items.addAll(response.items)\n\n // If we recieved less than we asked for it means we are done\n if (response.items.size() < pageSize) break\n }\n return items\n}\n\n\n/* Simple GET, returns a parsed json payload. No processing. */\ndef apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def request = rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (request.getResponseCode() == 200) {\n def payload = new JsonSlurper().parseText(request.content.text)\n return payload\n }\n else {\n throw new Exception(\"Server return HTTP code ${request.getResponseCode()}\")\n }\n}\n\n\n/* Raw GET method. */\ndef rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def auth = generateAuth(apiId, apiKey, endPoint)\n def headers = [\"Authorization\": auth, \"Content-Type\": \"application/json\", \"X-Version\":\"2\", \"External-User\":\"true\"]\n def url = \"https://${portalName}.logicmonitor.com/santaba/rest${endPoint}\"\n\n if (args) {\n def encodedArgs = []\n args.each{ k,v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n\n def request\n if (proxyInfo.enabled) {\n request = url.toURL().openConnection(proxyInfo.proxy)\n }\n else {\n request = url.toURL().openConnection()\n }\n request.setRequestMethod(\"GET\")\n request.setDoOutput(true)\n headers.each{ k,v ->\n request.addRequestProperty(k, v)\n }\n\n return request\n}\n\n\n/* Generate auth for API calls. */\nstatic String generateAuth(id, key, path) {\n Long epoch_time = System.currentTimeMillis()\n Mac hmac = Mac.getInstance(\"HmacSHA256\")\n hmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA256\"))\n def signature = Hex.encodeHexString(hmac.doFinal(\"GET${epoch_time}${path}\".getBytes())).bytes.encodeBase64()\n\n return \"LMv1 ${id}:${signature}:${epoch_time}\"\n}\n\n\n/* Helper method to remind the collector this device is not dead */\ndef keepAlive(hostProps) {\n // Update the liveHost set so tell the collector we are happy.\n hostId = hostProps.get(\"system.deviceId\").toInteger()\n def liveHostSet = LiveHostSet.getInstance()\n liveHostSet.flag(hostId)\n}"}, "groupMethod": "ilp", "groupExpr": "auto.ds.group"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.live.LiveHostSet\nimport org.apache.commons.codec.binary.Hex\nimport javax.crypto.Mac\nimport javax.crypto.spec.SecretKeySpec\nimport java.security.MessageDigest\n\n\nString apiId = hostProps.get(\"lmaccess.id\")?:hostProps.get(\"logicmonitor.access.id\")\nString apiKey = hostProps.get(\"lmaccess.key\")?:hostProps.get(\"logicmonitor.access.key\")\ndef portalName = hostProps.get(\"lmaccount\")?:Settings.getSetting(Settings.AGENT_COMPANY)\ndef collectorProxy = Settings.getSetting(\"proxy.enable\").toBoolean()\nMap proxyInfo = [:]\n\nif (collectorProxy) {\n proxyInfo = [\n enabled : true,\n host : Settings.getSetting(\"proxy.host\"),\n port : Settings.getSetting(\"proxy.port\"),\n user : Settings.getSetting(\"proxy.user\"),\n pass : Settings.getSetting(\"proxy.pass\")\n ]\n\n proxyInfo[\"proxy\"] = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo.host, proxyInfo.port.toInteger()))\n}\n\ndef dsDefinitions = [:]\n\napiGetManyV2(portalName, apiId, apiKey, \"/setting/datasources\", proxyInfo, [fields:'id,displayName,name,dataPoints']).each { ds->\n dsDefinitions[ds.id] = ds\n}\n\ndef dsInstances = apiGetV2(portalName, apiId, apiKey, \"/metrics/summary\", proxyInfo)\n\ndef alerts = apiGetManyV2(portalName, apiId, apiKey, \"/alert/alerts\", proxyInfo,\n [filter:'type:\"dataSourceAlert\"', fields:'severity,resourceTemplateId'])\n\ndef alertsPerDs = alerts.groupBy {it.resourceTemplateId}\n\ndsDefinitions.each{ id,ds ->\n def dsAlerts = alertsPerDs.get(id, [])\n def instanceCount = dsInstances.numberOfInstancesPerDS.get(ds.name, 0)\n def alertsDefined = ds.dataPoints.findAll{it.alertExpr != \"\"}.size()\n def wildvalue = ds.name.replaceAll(/[.#\\\\:= ]/,'_')\n\n println \"${wildvalue}.instanceCount=${instanceCount}\"\n println \"${wildvalue}.alertsDefined=${alertsDefined}\"\n println \"${wildvalue}.dataPointCount=${ds?.dataPoints?.size()}\"\n println \"${wildvalue}.activeAlerts=${dsAlerts.size()}\"\n\n /* Alert severity map.\n Warning - 2\n Error - 3\n Critical - 4\n */\n\n println \"${wildvalue}.activeWarningAlerts=${dsAlerts.findAll{it.severity == 2}.size()}\"\n println \"${wildvalue}.activeErrorAlerts=${dsAlerts.findAll{it.severity == 3}.size()}\"\n println \"${wildvalue}.activeCriticalAlerts=${dsAlerts.findAll{it.severity == 4}.size()}\"\n}\n\n// If script gets to this point, collector should consider this device alive\nkeepAlive(hostProps)\n\nreturn 0\n\n\n/* Paginated GET method. Returns a list of objects. */\nList apiGetManyV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n\n def pageSize = args.get('size', 1000) // Default the page size to 1000 if not specified.\n List items = []\n\n args['size'] = pageSize\n\n def pageCount = 0\n while (true) {\n pageCount += 1\n\n // Updated the args\n args['size'] = pageSize\n args['offset'] = items.size()\n\n def response = apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (response.get(\"errmsg\", \"OK\") != \"OK\") {\n throw new Exception(\"Santaba returned errormsg: ${payload?.errmsg}\")\n }\n items.addAll(response.items)\n\n // If we recieved less than we asked for it means we are done\n if (response.items.size() < pageSize) break\n }\n return items\n}\n\n\n/* Simple GET, returns a parsed json payload. No processing. */\ndef apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def request = rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (request.getResponseCode() == 200) {\n def payload = new JsonSlurper().parseText(request.content.text)\n return payload\n }\n else {\n throw new Exception(\"Server return HTTP code ${request.getResponseCode()}\")\n }\n}\n\n\n/* Raw GET method. */\ndef rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def auth = generateAuth(apiId, apiKey, endPoint)\n def headers = [\"Authorization\": auth, \"Content-Type\": \"application/json\", \"X-Version\":\"2\", \"External-User\":\"true\"]\n def url = \"https://${portalName}.logicmonitor.com/santaba/rest${endPoint}\"\n\n if (args) {\n def encodedArgs = []\n args.each{ k,v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n\n def request\n if (proxyInfo.enabled) {\n request = url.toURL().openConnection(proxyInfo.proxy)\n }\n else {\n request = url.toURL().openConnection()\n }\n request.setRequestMethod(\"GET\")\n request.setDoOutput(true)\n headers.each{ k,v ->\n request.addRequestProperty(k, v)\n }\n\n return request\n}\n\n\n/* Generate auth for API calls. */\nstatic String generateAuth(id, key, path) {\n Long epoch_time = System.currentTimeMillis()\n Mac hmac = Mac.getInstance(\"HmacSHA256\")\n hmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA256\"))\n def signature = Hex.encodeHexString(hmac.doFinal(\"GET${epoch_time}${path}\".getBytes())).bytes.encodeBase64()\n \n return \"LMv1 ${id}:${signature}:${epoch_time}\"\n}\n\n\n/* Helper method to remind the collector this device is not dead */\ndef keepAlive(hostProps) {\n // Update the liveHost set so tell the collector we are happy.\n hostId = hostProps.get(\"system.deviceId\").toInteger()\n def liveHostSet = LiveHostSet.getInstance()\n liveHostSet.flag(hostId)\n}"}, "datapoints": [{"name": "activeAlerts", "description": "Number of active alerts generated by this DataSource.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activeAlerts", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "activeCriticalAlerts", "description": "Number of active critical alerts generated by this DataSource.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activeCriticalAlerts", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "activeErrorAlerts", "description": "Number of active error alerts generated by this DataSource.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activeErrorAlerts", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "activeWarningAlerts", "description": "Number of active warning alerts generated by this DataSource.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activeWarningAlerts", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "alertsDefined", "description": "Number of alerts defined on this DataSource.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.alertsDefined", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dataPointCount", "description": "Number datapoints defined in this DataSource.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.dataPointCount", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "instanceCount", "description": "Count of all instances for specified DataSource instances monitored across all device, cloud, and Kubernetes resources. A single resource represents at least one instance, but may represent more if a DataSource discovers multiple instances per resource.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.instanceCount", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Alerts", "title": "Alerts", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "activeAlerts", "datapointName": "activeAlerts", "consolidationFn": "max"}, {"name": "activeCriticalAlerts", "datapointName": "activeCriticalAlerts", "consolidationFn": "max"}, {"name": "activeErrorAlerts", "datapointName": "activeErrorAlerts", "consolidationFn": "max"}, {"name": "activeWarningAlerts", "datapointName": "activeWarningAlerts", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Total active alerts", "color": "black", "datapointName": "activeAlerts", "isVirtual": false}, {"type": "stack", "legend": "Active critical alerts", "color": "red", "datapointName": "activeCriticalAlerts", "isVirtual": false}, {"type": "stack", "legend": "Active error alerts", "color": "orange2", "datapointName": "activeErrorAlerts", "isVirtual": false}, {"type": "stack", "legend": "Active warning alerts", "color": "yellow", "datapointName": "activeWarningAlerts", "isVirtual": false}]}, {"name": "Datapoints & Alerts", "title": "Datapoints & Alerts", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "alertsDefined", "datapointName": "alertsDefined", "consolidationFn": "max"}, {"name": "dataPointCount", "datapointName": "dataPointCount", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Alerts defined", "color": "red", "datapointName": "alertsDefined", "isVirtual": false}, {"type": "line", "legend": "Datapoints configured", "color": "blue", "datapointName": "dataPointCount", "isVirtual": false}]}, {"name": "Instance Count", "title": "Instance Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "instanceCount", "datapointName": "instanceCount", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "Total instances across devices", "color": "fuchsia", "datapointName": "instanceCount", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top DataSources by Instance Count", "title": "Top DataSources by Instance Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "instanceCount", "datapointName": "instanceCount", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "stack", "legend": "##INSTANCE##", "color": "silver", "datapointName": "instanceCount", "isVirtual": false}]}, {"name": "Top Datasources by Active Alerts", "title": "Top DataSources by Active Alerts", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "activeAlerts", "datapointName": "activeAlerts", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "activeAlerts", "isVirtual": false}]}, {"name": "Total Instance Count", "title": "Total Instance Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "aggregated": true, "scale1024": false, "rigid": false, "datapoints": [{"name": "instanceCount", "datapointName": "instanceCount", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "area", "legend": "Total instance count across all devices", "color": "fuchsia", "datapointName": "instanceCount", "isVirtual": false}]}]}

×DataSource: LogicMonitor_Portal_Overview (860)

{"name": "LogicMonitor_Portal_Overview", "description": "Monitor overview metrics on a LogicMonitor account.", "appliesTo": "hasCategory(\"LogicMonitorPortal\") && system.displayname =~ \".logicmonitor.com\"", "searchKeywords": "logicmonitor,portal metrics,api", "technicalNotes": "This module requires the \"addCategory_LogicMonitorPortal\" PropertySource to be installed, a device with a hostname and displayname including \"logicmonitor.com\", and the following properties configured:\n\nlmaccess.id - API Token ID\nlmaccess.key - API Token key\nlmaccount - (optional) Name of your LM account. This will default to whatever account this is running on.", "displayedAs": "LogicMonitor Portal Overview", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.live.LiveHostSet\nimport org.apache.commons.codec.binary.Hex\nimport javax.crypto.Mac\nimport javax.crypto.spec.SecretKeySpec\nimport java.security.MessageDigest\n\n\nString apiId = hostProps.get(\"lmaccess.id\")?:hostProps.get(\"logicmonitor.access.id\")\nString apiKey = hostProps.get(\"lmaccess.key\")?:hostProps.get(\"logicmonitor.access.key\")\ndef portalName = hostProps.get(\"lmaccount\")?:Settings.getSetting(Settings.AGENT_COMPANY)\ndef collectorProxy = Settings.getSetting(\"proxy.enable\").toBoolean()\nMap proxyInfo = [:]\n\nif (collectorProxy) {\n proxyInfo = [\n enabled : true,\n host : Settings.getSetting(\"proxy.host\"),\n port : Settings.getSetting(\"proxy.port\"),\n user : Settings.getSetting(\"proxy.user\"),\n pass : Settings.getSetting(\"proxy.pass\")\n ]\n\n proxyInfo[\"proxy\"] = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyInfo.host, proxyInfo.port.toInteger()))\n}\n\ndef summary = apiGetV2(portalName, apiId, apiKey, \"/metrics/summary\", proxyInfo)\n\nprintln \"numAlertsOpen=${summary[\"numberOfOpenAlerts\"]}\"\nprintln \"numAlertsYesterday=${summary[\"numberOfPreviousDayAlerts\"]}\"\nprintln \"numDevicesCS=${summary[\"numOfConfigSourceDevices\"]}\"\nprintln \"numDevicesLight=${summary[\"numberOfLightDevices\"]}\"\nprintln \"numSavedMaps=${summary[\"numOfSavedMaps\"]}\"\nprintln \"numRCARules=${summary[\"numberOfRootCauseAnalysisRules\"]}\"\nprintln \"numAlertRules=${summary[\"numberOfAlertRules\"]}\"\nprintln \"numDashboards=${summary[\"numberOfDashboards\"]}\"\nprintln \"numWidgets=${summary[\"numberOfWidgets\"]}\"\nprintln \"numReportsLast24Hrs=${summary[\"numberOfReportsInLast24Hrs\"]}\"\nprintln \"numDSInstances=${summary[\"numberOfDatasourceInstances\"]}\"\nprintln \"numDatapoints=${summary[\"numberOfDataPoints\"]}\"\nprintln \"numDatapointsComplex=${summary[\"numberOfComplexDataPoints\"]}\"\nprintln \"numAllowedDTConfigs=${summary[\"numberOfAllowedDTConfigs\"]}\"\nprintln \"numThresholdDynamic=${summary[\"numberOfDynamicThresholds\"]}\"\nprintln \"numThresholdStatic=${summary[\"numberOfStaticThresholds\"]}\"\nprintln \"numGroupStatic=${summary[\"hostGroupsInfo\"][\"static\"][\"size\"]}\"\nprintln \"numGroupStaticProps=${summary[\"hostGroupsInfo\"][\"static\"][\"props\"]}\"\nprintln \"numGroupDynamic=${summary[\"hostGroupsInfo\"][\"dynamic\"][\"size\"]}\"\nprintln \"numGroupDynamicProps=${summary[\"hostGroupsInfo\"][\"dynamic\"][\"props\"]}\"\n\n// If script gets to this point, collector should consider this device alive\nkeepAlive(hostProps)\n\nreturn 0\n\n\n/* Paginated GET method. Returns a list of objects. */\nList apiGetManyV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n\n def pageSize = args.get('size', 1000) // Default the page size to 1000 if not specified.\n List items = []\n\n args['size'] = pageSize\n\n def pageCount = 0\n while (true) {\n pageCount += 1\n\n // Updated the args\n args['size'] = pageSize\n args['offset'] = items.size()\n\n def response = apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (response.get(\"errmsg\", \"OK\") != \"OK\") {\n throw new Exception(\"Santaba returned errormsg: ${payload?.errmsg}\")\n }\n items.addAll(response.items)\n\n // If we recieved less than we asked for it means we are done\n if (response.items.size() < pageSize) break\n }\n return items\n}\n\n\n/* Simple GET, returns a parsed json payload. No processing. */\ndef apiGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def request = rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, args)\n if (request.getResponseCode() == 200) {\n def payload = new JsonSlurper().parseText(request.content.text)\n return payload\n }\n else {\n throw new Exception(\"Server return HTTP code ${request.getResponseCode()}\")\n }\n}\n\n\n/* Raw GET method. */\ndef rawGetV2(portalName, apiId, apiKey, endPoint, proxyInfo, Map args=[:]) {\n def auth = generateAuth(apiId, apiKey, endPoint)\n def headers = [\"Authorization\": auth, \"Content-Type\": \"application/json\", \"X-Version\":\"2\", \"External-User\":\"true\"]\n def url = \"https://${portalName}.logicmonitor.com/santaba/rest${endPoint}\"\n\n if (args) {\n def encodedArgs = []\n args.each{ k,v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n\n def request\n if (proxyInfo.enabled) {\n request = url.toURL().openConnection(proxyInfo.proxy)\n }\n else {\n request = url.toURL().openConnection()\n }\n request.setRequestMethod(\"GET\")\n request.setDoOutput(true)\n headers.each{ k,v ->\n request.addRequestProperty(k, v)\n }\n\n return request\n}\n\n\n/* Generate auth for API calls. */\nstatic String generateAuth(id, key, path) {\n Long epoch_time = System.currentTimeMillis()\n Mac hmac = Mac.getInstance(\"HmacSHA256\")\n hmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA256\"))\n def signature = Hex.encodeHexString(hmac.doFinal(\"GET${epoch_time}${path}\".getBytes())).bytes.encodeBase64()\n\n return \"LMv1 ${id}:${signature}:${epoch_time}\"\n}\n\n\n/* Helper method to remind the collector this device is not dead */\ndef keepAlive(hostProps) {\n // Update the liveHost set so tell the collector we are happy.\n hostId = hostProps.get(\"system.deviceId\").toInteger()\n def liveHostSet = LiveHostSet.getInstance()\n liveHostSet.flag(hostId)\n}"}, "datapoints": [{"name": "DynamicThresholdAlert", "description": "Alerts if numThresholdDynamic is greater than numAllowedDTConfigs.", "interpretMethod": "expression", "interpretExpr": "if(gt(numThresholdDynamic,numAllowedDTConfigs),1,0)", "type": "gauge", "dataType": 7, "threshold": "= 1", "noData": "Trigger warning alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "##HOST## is reporting a higher number of dynamic thresholds configured than allowed, placing the host into ##LEVEL## state. Reach out to your account manager to increase your allowed dynamic threshold limit.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "numAlertRules", "description": "Count of each saved alert rule definition in account.", "interpretMethod": "namevalue", "interpretExpr": "numAlertRules", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numAlertsOpen", "description": "Count of current open alerts in account.", "interpretMethod": "namevalue", "interpretExpr": "numAlertsOpen", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numAlertsYesterday", "description": "Count of all alerts triggered for the previous day (from 12 a.m. to 12 p.m.) in account.", "interpretMethod": "namevalue", "interpretExpr": "numAlertsYesterday", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numAllowedDTConfigs", "description": "Count of maximum dynamic threshold configurations allowed in account. This is only applicable for LogicMonitor Enterprise portals.", "interpretMethod": "namevalue", "interpretExpr": "numAllowedDTConfigs", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numDSInstances", "description": "Count of all DataSource instances across all device, cloud, and Kubernetes resources in account. For details on instance counts per DataSource, see LogicMonitor_Portal_DataSources.", "interpretMethod": "namevalue", "interpretExpr": "numDSInstances", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numDashboards", "description": "Count of all existing dashboards \u2014 public and private - in account.", "interpretMethod": "namevalue", "interpretExpr": "numDashboards", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numDatapoints", "description": "Total count of all datapoints (normal and complex) in use across DataSources in account. This count represents the number of times your datapoints are potentially collecting data for a resource. For example, a DataSource with five datapoints that is applied to five total instances will increase this count by 25.", "interpretMethod": "namevalue", "interpretExpr": "numDatapoints", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numDatapointsComplex", "description": "Count of complex datapoints in use across DataSources and resources in account.", "interpretMethod": "namevalue", "interpretExpr": "numDatapointsComplex", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numDevicesCS", "description": "Count of all resources to which ConfigSource LogicModules have been applied. This count is only applicable for portals with the ability to monitor and alert on configuration files.", "interpretMethod": "namevalue", "interpretExpr": "numDevicesCS", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numDevicesLight", "description": "Count of resources considered light devices (instance and datapoint counts below a defined threshold) in account.", "interpretMethod": "namevalue", "interpretExpr": "numDevicesLight", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numGroupDynamic", "description": "Count of dynamic resource groups in account.", "interpretMethod": "namevalue", "interpretExpr": "numGroupDynamic", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numGroupDynamicProps", "description": "Total count of group-level properties set across all dynamic resource groups.", "interpretMethod": "namevalue", "interpretExpr": "numGroupDynamicProps", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numGroupStatic", "description": "Count of static resource groups in account.", "interpretMethod": "namevalue", "interpretExpr": "numGroupStatic", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numGroupStaticProps", "description": "Total count of group-level properties set across all static resource groups.", "interpretMethod": "namevalue", "interpretExpr": "numGroupStaticProps", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numRCARules", "description": "Count of each saved root cause analysis definition in account. This count is only applicable for LogicMonitor Enterprise portals.", "interpretMethod": "namevalue", "interpretExpr": "numRCARules", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numReportsLast24Hrs", "description": "Count of all reports successfully generated in the past 24 hours\u2014either manually or via a report schedule.", "interpretMethod": "namevalue", "interpretExpr": "numReportsLast24Hrs", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numSavedMaps", "description": "Count of all saved topology maps in account.", "interpretMethod": "namevalue", "interpretExpr": "numSavedMaps", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numThresholdDynamic", "description": "Count of current number of dynamic thresholds in use in account. This represents the number of times your configured dynamic thresholds are potentially evaluated, meaning that if a dynamic threshold, even if only configured once, is inherited across multiple instances, each instance contributes to the total.", "interpretMethod": "namevalue", "interpretExpr": "numThresholdDynamic", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "numWidgets", "description": "Total count of all widgets across all dashboards in account. If the same widget is cloned or added to multiple dashboards, each addition becomes its own unique widget and is counted individually.", "interpretMethod": "namevalue", "interpretExpr": "numWidgets", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Alert & RCA Rules", "title": "Alert & RCA Rules", "verticalLabel": "count", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "numAlertRules", "datapointName": "numAlertRules", "consolidationFn": "max"}, {"name": "numRCARules", "datapointName": "numRCARules", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Alert rules", "color": "yellow", "datapointName": "numAlertRules", "isVirtual": false}, {"type": "line", "legend": "Root Cause Analysis rules", "color": "red", "datapointName": "numRCARules", "isVirtual": false}]}, {"name": "CS & Light Devices", "title": "CS & Light Devices", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "numDevicesCS", "datapointName": "numDevicesCS", "consolidationFn": "max"}, {"name": "numDevicesLight", "datapointName": "numDevicesLight", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "ConfigSource devices", "color": "orange2", "datapointName": "numDevicesCS", "isVirtual": false}, {"type": "line", "legend": "Light devices", "color": "aqua", "datapointName": "numDevicesLight", "isVirtual": false}]}, {"name": "Dashboards & Widgets", "title": "Dashboards & Widgets", "verticalLabel": "count", "min": 0.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "numDashboards", "datapointName": "numDashboards", "consolidationFn": "max"}, {"name": "numWidgets", "datapointName": "numWidgets", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Dashboards", "color": "navy", "datapointName": "numDashboards", "isVirtual": false}, {"type": "line", "legend": "Widgets", "color": "fuchsia", "datapointName": "numWidgets", "isVirtual": false}]}, {"name": "Datapoints", "title": "Datapoints", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "numDatapoints", "datapointName": "numDatapoints", "consolidationFn": "max"}, {"name": "numDatapointsComplex", "datapointName": "numDatapointsComplex", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "numDatapointsNormal", "expr": "numDatapoints - numDatapointsComplex"}], "lines": [{"type": "line", "legend": "Total datapoints", "color": "gray", "datapointName": "numDatapoints", "isVirtual": false}, {"type": "stack", "legend": "Complex datapoints", "color": "fuchsia", "datapointName": "numDatapointsComplex", "isVirtual": false}, {"type": "stack", "legend": "Normal datapoints", "color": "teal", "datapointName": "numDatapointsNormal", "isVirtual": true}]}, {"name": "Reports (Last 24 Hours)", "title": "Reports (Last 24 Hours)", "verticalLabel": "count", "min": 0.0, "displayPriority": 60, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "numReportsLast24Hrs", "datapointName": "numReportsLast24Hrs", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Reports ran in last 24 hours", "color": "orange", "datapointName": "numReportsLast24Hrs", "isVirtual": false}]}, {"name": "Resource Groups", "title": "Resource Groups", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "numGroupDynamic", "datapointName": "numGroupDynamic", "consolidationFn": "max"}, {"name": "numGroupDynamicProps", "datapointName": "numGroupDynamicProps", "consolidationFn": "max"}, {"name": "numGroupStatic", "datapointName": "numGroupStatic", "consolidationFn": "max"}, {"name": "numGroupStaticProps", "datapointName": "numGroupStaticProps", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Dynamic groups", "color": "navy", "datapointName": "numGroupDynamic", "isVirtual": false}, {"type": "line", "legend": "Dynamic group properties", "color": "aqua", "datapointName": "numGroupDynamicProps", "isVirtual": false}, {"type": "line", "legend": "Static groups", "color": "orange", "datapointName": "numGroupStatic", "isVirtual": false}, {"type": "line", "legend": "Static group properties", "color": "yellow", "datapointName": "numGroupStaticProps", "isVirtual": false}]}, {"name": "Saved Maps", "title": "Saved Maps", "verticalLabel": "count", "min": 0.0, "displayPriority": 40, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "numSavedMaps", "datapointName": "numSavedMaps", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Saved maps", "color": "olive", "datapointName": "numSavedMaps", "isVirtual": false}]}, {"name": "Thresholds", "title": "Thresholds", "verticalLabel": "count", "min": 0.0, "displayPriority": 25, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "numAllowedDTConfigs", "datapointName": "numAllowedDTConfigs", "consolidationFn": "max"}, {"name": "numThresholdDynamic", "datapointName": "numThresholdDynamic", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "remaining", "expr": "numAllowedDTConfigs - numThresholdDynamic"}], "lines": [{"type": "line", "legend": "Total allowed dynamic threshold configurations", "color": "gray", "datapointName": "numAllowedDTConfigs", "isVirtual": false}, {"type": "stack", "legend": "Dynamic thresholds", "color": "red", "datapointName": "numThresholdDynamic", "isVirtual": false}, {"type": "stack", "legend": "Remaining dynamic thresholds allowed", "color": "olive", "datapointName": "remaining", "isVirtual": true}]}, {"name": "Total DataSource Instances", "title": "Total DataSource Instances", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "numDSInstances", "datapointName": "numDSInstances", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "DataSource instances", "color": "blue", "datapointName": "numDSInstances", "isVirtual": false}]}]}

×DataSource: CommVault_Job_Backups (550)

{"name": "CommVault_Job_Backups", "description": "Monitors the results of the last executed CommVault job for each client/application type.", "appliesTo": "hasCategory(\"CommVault\")", "searchKeywords": "application,jobs,commvault,backups", "technicalNotes": "- requires 'commvault.user' & 'commvault.pass'.\n- CommVault job status descriptions: https://documentation.commvault.com/commvault/v11/article?p=6385.htm\nSupport doc: https://www.logicmonitor.com/support/commvault-monitoring\nData gaps will occur for instances where the job does not run during the lookback period, which defaults to 1 day. To customize the lookback period, add commvault.data.days to device properties with the number of days desired. Note that higher values can lead to script timeout due to API call response times.", "displayedAs": "CommVault Job Backups", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.collector3.CollectorDb\nimport groovy.json.JsonSlurper\nimport groovy.json.JsonOutput\n\nhostname = hostProps.get(\"system.hostname\")\ncommvault_user = hostProps.get(\"commvault.user\")\ncommvault_pass = (hostProps.get(\"commvault.pass\")).bytes.encodeBase64().toString() // base64 encoded\ncommvault_domain = (hostProps.get(\"commvault.domain\") ?: '') // Needs to be blank NOT NULL if not set\ncommvault_port = (hostProps.get(\"commvault.port\") ?: '81') // Default port is 81\n\ndef commvault_data_days = (hostProps.get(\"commvault.data.days\") ?: '1')\ndef lookbackSeconds = (commvault_data_days.toLong() * 24 * 60 * 60)\n\n// To run in debug mode, set to true\nBoolean debug = false\n\nLMDebugPrint(\"\"\"\n*** DEBUG MODE ENABLED ***\n Host: ${hostname}\n User: ${commvault_user}\n Domain: ${commvault_domain}\n Port: ${commvault_port}\n Searching for jobs run in the last ${commvault_data_days} days\n\"\"\", debug\n)\n\nif (!probeTcpPort(hostname, commvault_port.toInteger())) {\n println \"Port ${commvault_port} is closed on ${hostname}, unable to continue.\"\n return 1\n}\n\njsonSlurper = new JsonSlurper()\n\n// login and grab an API token and save it.\ndef api_token = getToken()\n\n// Job counter for debug purposes\nInteger jobCount = 0\n\ntry {\n def now = new Date().getTime().toLong() / 1000\n def jobs = getPaginatedJobs(api_token, [jobFilter: 'backup', completedJobLookupTime: lookbackSeconds], debug)\n\n jobs.groupBy { job->\n [client:job.jobSummary.subclient.clientId,\n subclient:job.jobSummary.subclient.subclientId,\n application:job.jobSummary.subclient.applicationId]\n }.each { key, matching_jobs ->\n def wildvalue = \"${key.client}.${key.subclient}.${key.application}\"\n\n // Sort all the entries by jobStartTime, find the latest job.\n matching_jobs = matching_jobs.sort { x,y ->\n x.jobSummary.jobStartTime <=> y.jobSummary.jobStartTime\n }\n def latest_job = matching_jobs[-1] // Pop the last job from the sorted list\n\n\n def ilp = [\"commvault.backup.app\": latest_job.jobSummary.subclient.appName,\n \"commvault.backup.client\": latest_job.jobSummary.subclient.clientName,\n \"commvault.backup.subclient\": latest_job.jobSummary.subclient.subclientName,\n \"commvault.backup.backup_set\": latest_job.jobSummary.backupSetName,\n \"commvault.backup.storage_policy\": latest_job.jobSummary.storagePolicy?.storagePolicyName\n ]\n\n ilp.findAll{it.value}\n .collect {\"${it.key}=${it.value}\"}\n .join(\"&\")\n\n def wildalias = \"${latest_job.jobSummary.subclient.clientName}/${latest_job.jobSummary.subclient.subclientName} (${latest_job.jobSummary.subclient.appName})\"\n println \"${wildvalue}##${wildalias}######${ilp}\"\n }\n}\nfinally {\n closeSession(api_token)\n}\n\nreturn 0\n\n\n/**\n * Helper function to print out debug messages for troubleshooting purposes.\n */\nvoid LMDebugPrint(message, Boolean debug=false) {\n if (debug) {\n println(message.toString())\n }\n}\n\n\ndef getPaginatedJobs(token, args = [:], Boolean debug=false, page_limit = 100) {\n def url = \"/SearchSvc/CVWebService.svc/Job\"\n\n if (args) {\n def encodedArgs = []\n args.each { k, v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n\n List jobs = []\n def page_count = 0\n\n while (page_count < page_limit) {\n def response = getAPIOutput(url, token, headers = [\"offset\": jobs.size().toString()])\n jobs.addAll(response.jobs)\n\n if (jobs.size() == response.totalRecordsWithoutPaging) {\n break\n }\n\n page_count += 1\n }\n\n LMDebugPrint(\"${page_count} pages queried to retrieve full data set\\n\", debug)\n\n return jobs\n}\n\n\ndef getAPIOutput(api_endpoint, token, headers = [:]) {\n // GET Client ID information\n def getClientUrl = new URL(\"http://\" + hostname + \":\" + commvault_port + api_endpoint)\n def connectionGetClient = getClientUrl.openConnection()\n connectionGetClient.setRequestMethod(\"GET\")\n connectionGetClient.setRequestProperty(\"Accept\", \"application/json\")\n connectionGetClient.setRequestProperty(\"Authtoken\", token)\n\n // Add user provided headers, if any\n headers.each { k, v ->\n connectionGetClient.setRequestProperty(k, v)\n }\n\n def response = connectionGetClient.inputStream.withReader { Reader reader -> reader.text }\n\n return jsonSlurper.parseText(response)\n}\n\n\n/**\n * Helper method that handles initial login (POST) and captures the API token for subsequent GET requests.\n * @return token\n */\ndef getToken() {\n // Create POST URL\n def loginUrl = new URL(\"http://\" + hostname + \":\" + commvault_port + \"/SearchSvc/CVWebService.svc/Login\")\n connection = loginUrl.openConnection()\n connection.setRequestMethod(\"POST\")\n connection.setRequestProperty(\"Content-Type\", \"application/xml\")\n connection.setRequestProperty(\"Accept\", \"application/json\")\n connection.setDoOutput(true)\n\n // Build credential check\n def sAXLRequest = '''\n<DM2ContentIndexing_CheckCredentialReq mode=\"Webconsole\" \n domain=\"''' + commvault_domain + '''\" \n username=\"''' + commvault_user + '''\"\n password=\"''' + commvault_pass + '''\" />\n'''\n\n // Write credential request to output stream\n def writer = new OutputStreamWriter(connection.getOutputStream())\n writer.write(sAXLRequest)\n writer.flush()\n\n response = connection.inputStream.withReader { Reader reader -> reader.text }\n jsonResponse = new JsonSlurper().parseText(response)\n\n\n\n if(jsonResponse.errList?.errLogMessage){\n throw new Exception(\"Exception while trying to login:\\n${response}\")\n }\n\n def token = jsonResponse.token\n\n return token\n}\n\n\n/**\n * Helper method that handles closing our session (POST) and expires the token.\n * @param token\n * @return\n */\ndef closeSession(token) {\n // Make sure we fully log out and close the entire session connection.\n def logouturl = new URL(\"http://\" + hostname + \":\" + commvault_port + \"/SearchSvc/CVWebService.svc/Logout\")\n connectionLogout = logouturl.openConnection()\n connectionLogout.setRequestMethod(\"POST\")\n connectionLogout.setRequestProperty(\"Accept\", \"application/json\")\n connectionLogout.setRequestProperty(\"Authtoken\", token)\n connectionLogout.setDoOutput(true)\n}\n\n\nstatic boolean probeTcpPort(String host, int port) {\n Socket socket = null\n try {\n socket = new Socket()\n socket.connect(new InetSocketAddress(host, port.toInteger()), 3000)\n return true\n } catch (IOException ignored) {\n } finally {\n socket.close()\n }\n return false\n}"}, "groupMethod": "ilp", "groupExpr": "auto.commvault.backup.app"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper\nimport groovy.json.JsonOutput\n\nhostname = hostProps.get(\"system.hostname\")\ncommvault_user = hostProps.get(\"commvault.user\")\ncommvault_pass = (hostProps.get(\"commvault.pass\")).bytes.encodeBase64().toString() // base64 encoded\ncommvault_domain = (hostProps.get(\"commvault.domain\") ?: '') // Needs to be blank NOT NULL if not set\ncommvault_port = (hostProps.get(\"commvault.port\") ?: '81') // Default port is 81\n\ndef commvault_data_days = (hostProps.get(\"commvault.data.days\") ?: '1')\ndef lookbackSeconds = (commvault_data_days.toLong() * 24 * 60 * 60)\n\n// To run in debug mode, set to true\nBoolean debug = false\n\nLMDebugPrint(\"\"\"\n*** DEBUG MODE ENABLED ***\n Host: ${hostname}\n User: ${commvault_user}\n Domain: ${commvault_domain}\n Port: ${commvault_port}\n Searching for jobs run in the last ${commvault_data_days} days\n\"\"\", debug\n)\n\nif (!probeTcpPort(hostname, commvault_port.toInteger())) {\n println \"Port ${commvault_port} is closed on ${hostname}, unable to continue\"\n return 1\n}\n\njsonSlurper = new JsonSlurper()\n\n// login and grab an API token and save it.\ndef api_token = getToken()\n\nMap job_status_map = [\n 'Committed' : 0,\n 'Completed' : 1,\n 'Running' : 2,\n 'Running (cannot be verified)' : 3,\n 'Queued' : 4,\n 'Waiting' : 5,\n 'Pending' : 6,\n 'Suspend' : 7,\n 'Suspended' : 8,\n 'Completed w/ one or more warnings': 9,\n 'Completed w/ one or more errors' : 10,\n 'Kill Pending' : 11,\n 'Killed' : 12,\n 'Interrupt Pending' : 13,\n 'Interrupted' : 14,\n 'Abnormal Terminated Cleanup' : 15,\n 'Failed' : 16,\n 'Failed to Start' : 17,\n]\n\n/* currentPhase lookup - Decoded from what was observed during development.\n 0 - Inactive\n 2 - Discover\n 4 - Backup (Incremental?)\n 7 - Backup (Full?)\n 8 - Archive\n */\n\n// Job counter for debug purposes\nInteger jobCount = 0\n\ntry {\n def now = new Date().getTime().toLong() / 1000\n def jobs = getPaginatedJobs(api_token, [jobFilter: 'backup', completedJobLookupTime: lookbackSeconds], debug)\n\n jobs.groupBy { job->\n [client:job.jobSummary.subclient.clientId,\n subclient:job.jobSummary.subclient.subclientId,\n application:job.jobSummary.subclient.applicationId]\n }.each { key, matching_jobs->\n def wildvalue = \"${key.client}.${key.subclient}.${key.application}\"\n jobCount++\n\n // Sort all the entries by jobStartTime, find the latest job.\n matching_jobs = matching_jobs.sort { x,y ->\n x.jobSummary.jobStartTime <=> y.jobSummary.jobStartTime\n }\n\n\n // Find jobs that haven't ended but have updates, this avoids including all pending/suspended jobs.\n def jobs_in_flight = matching_jobs.findAll{it.jobSummary.jobEndTime == 0 && it.jobSummary.lastUpdateTime != 0}\n\n if (debug) {\n jobs_in_flight.each {\n println JsonOutput.prettyPrint(JsonOutput.toJson(it))\n }\n }\n println \"${wildvalue}.activeBackups=${jobs_in_flight.size()}\"\n\n def latest_job = matching_jobs[-1] // Pop the last job from the sorted list\n\n println \"${wildvalue}.percentComplete=${latest_job.jobSummary.percentComplete}\"\n println \"${wildvalue}.percentSavings=${latest_job.jobSummary.percentSavings}\"\n\n println \"${wildvalue}.status=${job_status_map.get(latest_job.jobSummary.status, -1)}\"\n println \"${wildvalue}.level=${latest_job.jobSummary.backupLevel}\"\n println \"${wildvalue}.currentPhase=${latest_job.jobSummary.currentPhase}\"\n println \"${wildvalue}.currentPhaseName=${latest_job.jobSummary.currentPhaseName}\"\n\n println \"${wildvalue}.startedAgo=${now - latest_job.jobSummary.jobStartTime}\"\n\n def endedAgo = latest_job.jobSummary.jobEndTime\n if (endedAgo != 0) {\n endedAgo = now - endedAgo\n }\n\n println \"${wildvalue}.errorType=${latest_job.jobSummary.errorType}\"\n \n println \"${wildvalue}.endedAgo=${endedAgo}\"\n println \"${wildvalue}.elapsedTime=${latest_job.jobSummary.jobElapsedTime}\"\n\n println \"${wildvalue}.sizeOfApplication=${latest_job.jobSummary.sizeOfApplication}\"\n println \"${wildvalue}.sizeOfMediaOnDisk=${latest_job.jobSummary.sizeOfMediaOnDisk}\"\n println \"${wildvalue}.totalFailedFiles=${latest_job.jobSummary.totalFailedFiles}\"\n println \"${wildvalue}.totalFailedFolders=${latest_job.jobSummary.totalFailedFolders}\"\n println \"${wildvalue}.totalNumOfFiles=${latest_job.jobSummary.totalNumOfFiles}\"\n\n }\n}\nfinally {\n closeSession(api_token)\n}\n\nLMDebugPrint(\"${jobCount} jobs found. If you are expecting more jobs, try increasing the number of days queried by assigning commvault.data.days to host properties.\", debug)\n\nreturn 0\n\n\n/**\n * Helper function to print out debug messages for troubleshooting purposes.\n */\nvoid LMDebugPrint(message, Boolean debug=false) {\n if (debug) {\n println(message.toString())\n }\n}\n\n\ndef getPaginatedJobs(token, args = [:], Boolean debug=false, page_limit = 100) {\n def url = \"/SearchSvc/CVWebService.svc/Job\"\n\n if (args) {\n def encodedArgs = []\n args.each { k, v ->\n encodedArgs << \"${k}=${java.net.URLEncoder.encode(v.toString(), \"UTF-8\")}\"\n }\n url += \"?${encodedArgs.join('&')}\"\n }\n\n List jobs = []\n def page_count = 0\n\n while (page_count < page_limit) {\n def response = getAPIOutput(url, token, headers = [\"offset\": jobs.size().toString()])\n jobs.addAll(response.jobs)\n\n if (jobs.size() == response.totalRecordsWithoutPaging) {\n break\n }\n\n page_count += 1\n }\n\n LMDebugPrint(\"${page_count} pages queried to retrieve full data set\\n\", debug)\n\n return jobs\n}\n\n\ndef getAPIOutput(api_endpoint, token, headers = [:]) {\n // GET Client ID information\n def getClientUrl = new URL(\"http://\" + hostname + \":\" + commvault_port + api_endpoint)\n def connectionGetClient = getClientUrl.openConnection()\n connectionGetClient.setRequestMethod(\"GET\")\n connectionGetClient.setRequestProperty(\"Accept\", \"application/json\")\n connectionGetClient.setRequestProperty(\"Authtoken\", token)\n\n // Add user provided headers, if any\n headers.each { k, v ->\n connectionGetClient.setRequestProperty(k, v)\n }\n\n def response = connectionGetClient.inputStream.withReader { Reader reader -> reader.text }\n\n return jsonSlurper.parseText(response)\n}\n\n\n/**\n * Helper method that handles initial login (POST) and captures the API token for subsequent GET requests.\n * @return token\n */\ndef getToken() {\n // Create POST URL.\n def loginUrl = new URL(\"http://\" + hostname + \":\" + commvault_port + \"/SearchSvc/CVWebService.svc/Login\")\n connection = loginUrl.openConnection()\n connection.setRequestMethod(\"POST\")\n connection.setRequestProperty(\"Content-Type\", \"application/xml\")\n connection.setRequestProperty(\"Accept\", \"application/json\")\n connection.setDoOutput(true)\n\n // Build credential check\n def sAXLRequest = '''\n<DM2ContentIndexing_CheckCredentialReq mode=\"Webconsole\" \n domain=\"''' + commvault_domain + '''\" \n username=\"''' + commvault_user + '''\"\n password=\"''' + commvault_pass + '''\" />\n'''\n\n // Write credential request to output stream.\n def writer = new OutputStreamWriter(connection.getOutputStream())\n writer.write(sAXLRequest)\n writer.flush()\n\n response = connection.inputStream.withReader { Reader reader -> reader.text }\n jsonResponse = new JsonSlurper().parseText(response)\n\n if (!jsonResponse.errList.errLogMessage.isEmpty()) {\n throw new Exception(\"Exception while trying to login:\\n${response}\")\n }\n\n def token = jsonResponse.token\n\n return token\n}\n\n\n/**\n * Helper method that handles closing our session (POST) and expires the token.\n * @param token\n * @return\n */\ndef closeSession(token) {\n // Make sure we fully log out and close the entire session connection.\n def logouturl = new URL(\"http://\" + hostname + \":\" + commvault_port + \"/SearchSvc/CVWebService.svc/Logout\")\n connectionLogout = logouturl.openConnection()\n connectionLogout.setRequestMethod(\"POST\")\n connectionLogout.setRequestProperty(\"Accept\", \"application/json\")\n connectionLogout.setRequestProperty(\"Authtoken\", token)\n connectionLogout.setDoOutput(true)\n}\n\n\nstatic boolean probeTcpPort(String host, int port) {\n Socket socket = null\n try {\n socket = new Socket()\n socket.connect(new InetSocketAddress(host, port.toInteger()), 3000)\n return true\n } catch (IOException ignored) {\n } finally {\n socket.close()\n }\n return false\n}"}, "datapoints": [{"name": "activeBackups", "description": "Number of instances of this job currently running.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.activeBackups", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "currentPhase", "description": "ID of the current job phase.\n\nCommvault does not publish what these ID's translate to, but they could be useful in debugging.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.currentPhase", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "elapsedTime", "description": "Elapsed time while the job is running.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.elapsedTime", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "endedAgo", "description": "Time since this job last ended.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.endedAgo", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "level", "description": "Level of backup.\n1=Full,\n2=Incremental,\n3=Differential,\n4=Synthetic Full", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.level", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "percentComplete", "description": "The progress of the job shown as a percentage.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.percentComplete", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "percentSavings", "description": "The percentage of space saved due to deduplication and compression, if employed.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.percentSavings", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sizeOfApplication", "description": "The amount of application data that was protected during the job.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sizeOfApplication", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sizeOfMediaOnDisk", "description": "Size of the data stored on the media. This is the size of the data after deduplication and compression, if employed. This amount also includes metadata information, so in some cases, it could be larger than the actual size of the backed up data.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.sizeOfMediaOnDisk", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "startedAgo", "description": "Time since this job was last started.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.startedAgo", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "status", "description": "Status of the last job:\n0=Commited,\n1=Completed,\n2=Running,\n3=Running (cannot be verified),\n4=Queued,\n5=Waiting,\n6=Pending,\n7=Suspend,\n8=Suspended,\n9=Completed w/ one or more warnings,\n10=Completed w/ one or more errors,\n11=Kill Pending,\n12=Killed,\n13=Interrupt Pending,\n14=Interrupted,\n15=Abnormal Terminated Cleanup,\n16= Failed,\n17=Failed To start", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.status", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "> 7 9", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "Status for Backup ##INSTANCE## on ##HOST## entered a ##LEVEL## state with a value of ##VALUE##.\n\nThis started at ##START## or ##DURATION## ago.\n\nThe status field can be decoded using the following table:\n0=Commited,\n1=Completed,\n2=Running,\n3=Running (Cannot be Verified),\n4=Queued,\n5=Waiting,\n6=Pending,\n7=Suspend,\n8=Suspended,\n9=Completed w/ one or more warnings,\n10=Completed w/one or more errors,\n11=Kill Pending,\n12=Killed,\n13=Interrupt Pending,\n14=Interrupted,\n15=Abnormal Terminated Cleanup,\n16= Failed,\n17=Failed To start"}, {"name": "totalFailedFiles", "description": "The total number of files that failed during the job.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totalFailedFiles", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "totalFailedFolders", "description": "The total number of folders that failed during the job.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totalFailedFolders", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "totalNumOfFiles", "description": "The total number of files processed during the job.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.totalNumOfFiles", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Backup Sizes", "title": "Backup Sizes", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 40, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "sizeOfApplication", "datapointName": "sizeOfApplication", "consolidationFn": "average"}, {"name": "sizeOfMediaOnDisk", "datapointName": "sizeOfMediaOnDisk", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Application", "color": "lime", "datapointName": "sizeOfApplication", "isVirtual": false}, {"type": "line", "legend": "On Disk", "color": "silver", "datapointName": "sizeOfMediaOnDisk", "isVirtual": false}]}, {"name": "Failures", "title": "Failures", "verticalLabel": "count", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "totalFailedFiles", "datapointName": "totalFailedFiles", "consolidationFn": "average"}, {"name": "totalFailedFolders", "datapointName": "totalFailedFolders", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Files", "color": "red", "datapointName": "totalFailedFiles", "isVirtual": false}, {"type": "line", "legend": "Folders", "color": "orange2", "datapointName": "totalFailedFolders", "isVirtual": false}]}, {"name": "Files in Process", "title": "Files in Process", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "totalNumOfFiles", "datapointName": "totalNumOfFiles", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Files", "color": "silver", "datapointName": "totalNumOfFiles", "isVirtual": false}]}, {"name": "Percent Complete", "title": "Percent Complete", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 23, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "percentComplete", "datapointName": "percentComplete", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Completion", "color": "blue", "datapointName": "percentComplete", "isVirtual": false}]}, {"name": "Percent Saved", "title": "Percent Saved", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 25, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "percentSavings", "datapointName": "percentSavings", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Savings", "color": "olive", "datapointName": "percentSavings", "isVirtual": false}]}, {"name": "Status", "title": "Status", "verticalLabel": "status code", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "currentPhase", "datapointName": "currentPhase", "consolidationFn": "average"}, {"name": "level", "datapointName": "level", "consolidationFn": "average"}, {"name": "status", "datapointName": "status", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Current Phase", "color": "yellow", "datapointName": "currentPhase", "isVirtual": false}, {"type": "line", "legend": "Backup Level", "color": "olive", "datapointName": "level", "isVirtual": false}, {"type": "line", "legend": "Status", "color": "orange2", "datapointName": "status", "isVirtual": false}]}], "overviewGraphs": [{"name": "Active Backups", "title": "Active Backups Jobs", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": true, "scale1024": false, "rigid": false, "datapoints": [{"name": "Active", "datapointName": "activeBackups", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "stack", "legend": "Active Jobs", "color": "silver", "datapointName": "Active", "isVirtual": false}]}, {"name": "Longest Duration (Top 10)", "title": "Longest Duration (Top 10)", "verticalLabel": "minutes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "elapsedTime", "datapointName": "elapsedTime", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "elapsedTime_minutes", "expr": "elapsedTime/60"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "elapsedTime_minutes", "isVirtual": true}]}, {"name": "Oldest Backups (Top 10)", "title": "Oldest Backups (Top 10)", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "endedAgo", "datapointName": "endedAgo", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "endedAgo_days", "expr": "endedAgo/(3600*24)"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "endedAgo_days", "isVirtual": true}]}, {"name": "Status Overview (Top 10)", "title": "Status Overview (Top 10)", "verticalLabel": "status code", "min": -1.0, "max": 18.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "status", "datapointName": "status", "consolidationFn": "average", "aggregateMethod": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "status", "isVirtual": false}]}]}

×DataSource: CommVault_Storage_Pools (555)

{"name": "CommVault_Storage_Pools", "description": "Reports size and utilization of CommVault storage pools.", "appliesTo": "hasCategory(\"CommVault\")", "searchKeywords": "pool,commvault,storage,backups", "technicalNotes": "- requires 'commvault.user' & 'commvault.pass'", "displayedAs": "CommVault Storage Pools", "collectionInterval": "5m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper;\nimport groovy.json.JsonOutput;\n\nhostname = hostProps.get(\"system.hostname\");\ncommvault_user = hostProps.get(\"commvault.user\");\ncommvault_pass = (hostProps.get(\"commvault.pass\")).bytes.encodeBase64().toString() // base64 encoded\ncommvault_domain = (hostProps.get(\"commvault.domain\") ?: '') // Needs to be blank NOT NULL if not set\ncommvault_port = (hostProps.get(\"commvault.port\") ?: '81') // Default port is 81\n\ndef commvault_data_days = (hostProps.get(\"commvault.data.days\") ?: '1')\ndef lookbackSeconds = (commvault_data_days.toLong() * 24 * 60 * 60)\n\ndef debug = false\n\nif (!probeTcpPort(hostname, commvault_port.toInteger())) {\n println \"Port ${commvault_port} is closed on ${hostname}, unable to continue\"\n return 1\n}\n\njsonSlurper = new JsonSlurper()\n\n// login and grab an API token and save it.\ndef api_token = getToken()\n\ntry {\n def storagePools = getAPIOutput(\"/SearchSvc/CVWebService.svc/StoragePool\", api_token)\n\n storagePools.storagePoolList.each { storagePoolInfo ->\n ilp = [\"commvault.pool.storageType\":storagePoolInfo.storageType,\n \"commvault.pool.capacity\": storagePoolInfo.totalCapacity\n ].collect {\"${it.key}=${it.value}\"}.join(\"&\")\n\n println \"${storagePoolInfo.storagePoolEntity.storagePoolId}##${storagePoolInfo.storagePoolEntity.storagePoolName}######${ilp}\"\n }\n}\nfinally {\n closeSession(api_token)\n}\n\nreturn 0\n\n\n\ndef getAPIOutput(api_endpoint, token, headers = [:]) {\n // GET Client ID information\n def getClientUrl = new URL(\"http://\" + hostname + \":\" + commvault_port + api_endpoint);\n def connectionGetClient = getClientUrl.openConnection();\n connectionGetClient.setRequestMethod(\"GET\");\n connectionGetClient.setRequestProperty(\"Accept\", \"application/json\");\n connectionGetClient.setRequestProperty(\"Authtoken\", token);\n\n // Add user provided headers, if any\n headers.each { k, v ->\n connectionGetClient.setRequestProperty(k, v)\n }\n\n def response = connectionGetClient.inputStream.withReader { Reader reader -> reader.text }\n\n return jsonSlurper.parseText(response);\n}\n\n/**\n * Helper method that handles initial login (POST) and captures the API token for subsequent GET requests.\n * @return token\n */\ndef getToken()\n{\n // Create POST URL.\n def loginUrl = new URL(\"http://\" + hostname + \":\" + commvault_port + \"/SearchSvc/CVWebService.svc/Login\");\n connection = loginUrl.openConnection();\n connection.setRequestMethod(\"POST\");\n connection.setRequestProperty(\"Content-Type\", \"application/xml\");\n connection.setRequestProperty(\"Accept\", \"application/json\");\n connection.setDoOutput(true);\n\n // Build credential check\n def sAXLRequest = '''\n<DM2ContentIndexing_CheckCredentialReq mode=\"Webconsole\" \n domain=\"''' + commvault_domain + '''\" \n username=\"''' + commvault_user + '''\"\n password=\"''' + commvault_pass + '''\" />\n''';\n\n // Write credential request to output stream.\n def writer = new OutputStreamWriter(connection.getOutputStream());\n writer.write(sAXLRequest);\n writer.flush();\n\n response = connection.inputStream.withReader { Reader reader -> reader.text }\n jsonResponse = new JsonSlurper().parseText(response);\n\n if(!jsonResponse.errList.errLogMessage.isEmpty()){\n throw new Exception(\"Exception while trying to login:\\n${response}\")\n }\n \n def token = jsonResponse.token;\n\n return token\n}\n\n/**\n * Helper method that handles closing our session (POST) and expires the token.\n * @param token\n * @return\n */\ndef closeSession(token)\n{\n // Make sure we fully log out and close the entire session connection.\n def logouturl = new URL(\"http://\" + hostname + \":\" + commvault_port + \"/SearchSvc/CVWebService.svc/Logout\");\n connectionLogout = logouturl.openConnection();\n connectionLogout.setRequestMethod(\"POST\");\n connectionLogout.setRequestProperty(\"Accept\", \"application/json\");\n connectionLogout.setRequestProperty(\"Authtoken\", token);\n connectionLogout.setDoOutput(true);\n}\n\nstatic boolean probeTcpPort(String host, int port) {\n Socket socket = null;\n try {\n socket = new Socket();\n socket.connect(new InetSocketAddress(host, port.toInteger()), 3000);\n return true;\n } catch (IOException ignored) {\n } finally {\n socket.close()\n }\n return false;\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonSlurper;\nimport groovy.json.JsonOutput;\n\nhostname = hostProps.get(\"system.hostname\");\ncommvault_user = hostProps.get(\"commvault.user\");\ncommvault_pass = (hostProps.get(\"commvault.pass\")).bytes.encodeBase64().toString() // base64 encoded\ncommvault_domain = (hostProps.get(\"commvault.domain\") ?: '') // Needs to be blank NOT NULL if not set\ncommvault_port = (hostProps.get(\"commvault.port\") ?: '81') // Default port is 81\n\ndef commvault_data_days = (hostProps.get(\"commvault.data.days\") ?: '1')\ndef lookbackSeconds = (commvault_data_days.toLong() * 24 * 60 * 60)\n\ndef debug = false\n\nif (!probeTcpPort(hostname, commvault_port.toInteger())) {\n println \"Port ${commvault_port} is closed on ${hostname}, unable to continue\"\n return 1\n}\n\njsonSlurper = new JsonSlurper()\n\n// login and grab an API token and save it.\ndef api_token = getToken()\n\nLong MegToBytes = 1024*1024\n\ntry {\n def storagePools = getAPIOutput(\"/SearchSvc/CVWebService.svc/StoragePool\", api_token)\n storagePools.storagePoolList.each { storagePoolInfo->\n\n def wildvalue = storagePoolInfo.storagePoolEntity.storagePoolId\n println \"${wildvalue}.freeSpace=${storagePoolInfo.totalFreeSpace * MegToBytes}\"\n println \"${wildvalue}.capacity=${storagePoolInfo.totalCapacity * MegToBytes}\"\n def usedSpace = (storagePoolInfo.totalCapacity - storagePoolInfo.totalFreeSpace) * MegToBytes\n def usedPercentage = (usedSpace / (storagePoolInfo.totalCapacity* MegToBytes)) * 100\n println \"${wildvalue}.usedSpace=${usedSpace}\"\n println \"${wildvalue}.usedPercent=${usedPercentage}\"\n\n println \"${wildvalue}.online=${(storagePoolInfo.status == 'Online')? 1:0}\"\n println \"${wildvalue}.statusString=${storagePoolInfo.status}\"\n }\n}\nfinally {\n closeSession(api_token)\n}\n\nreturn 0\n\ndef getAPIOutput(api_endpoint, token, headers = [:]) {\n // GET Client ID information\n def getClientUrl = new URL(\"http://\" + hostname + \":\" + commvault_port + api_endpoint);\n def connectionGetClient = getClientUrl.openConnection();\n connectionGetClient.setRequestMethod(\"GET\");\n connectionGetClient.setRequestProperty(\"Accept\", \"application/json\");\n connectionGetClient.setRequestProperty(\"Authtoken\", token);\n\n // Add user provided headers, if any\n headers.each { k, v ->\n connectionGetClient.setRequestProperty(k, v)\n }\n\n def response = connectionGetClient.inputStream.withReader { Reader reader -> reader.text }\n\n return jsonSlurper.parseText(response);\n}\n\n/**\n * Helper method that handles initial login (POST) and captures the API token for subsequent GET requests.\n * @return token\n */\ndef getToken()\n{\n // Create POST URL.\n def loginUrl = new URL(\"http://\" + hostname + \":\" + commvault_port + \"/SearchSvc/CVWebService.svc/Login\");\n connection = loginUrl.openConnection();\n connection.setRequestMethod(\"POST\");\n connection.setRequestProperty(\"Content-Type\", \"application/xml\");\n connection.setRequestProperty(\"Accept\", \"application/json\");\n connection.setDoOutput(true);\n\n // Build credential check\n def sAXLRequest = '''\n<DM2ContentIndexing_CheckCredentialReq mode=\"Webconsole\" \n domain=\"''' + commvault_domain + '''\" \n username=\"''' + commvault_user + '''\"\n password=\"''' + commvault_pass + '''\" />\n''';\n\n // Write credential request to output stream.\n def writer = new OutputStreamWriter(connection.getOutputStream());\n writer.write(sAXLRequest);\n writer.flush();\n\n response = connection.inputStream.withReader { Reader reader -> reader.text }\n jsonResponse = new JsonSlurper().parseText(response);\n\n if(!jsonResponse.errList.errLogMessage.isEmpty()){\n throw new Exception(\"Exception while trying to login:\\n${response}\")\n }\n\n def token = jsonResponse.token;\n\n return token\n}\n\n/**\n * Helper method that handles closing our session (POST) and expires the token.\n * @param token\n * @return\n */\ndef closeSession(token)\n{\n // Make sure we fully log out and close the entire session connection.\n def logouturl = new URL(\"http://\" + hostname + \":\" + commvault_port + \"/SearchSvc/CVWebService.svc/Logout\");\n connectionLogout = logouturl.openConnection();\n connectionLogout.setRequestMethod(\"POST\");\n connectionLogout.setRequestProperty(\"Accept\", \"application/json\");\n connectionLogout.setRequestProperty(\"Authtoken\", token);\n connectionLogout.setDoOutput(true);\n}\n\nstatic boolean probeTcpPort(String host, int port) {\n Socket socket = null;\n try {\n socket = new Socket();\n socket.connect(new InetSocketAddress(host, port.toInteger()), 3000);\n return true;\n } catch (IOException ignored) {\n } finally {\n socket.close()\n }\n return false;\n}"}, "datapoints": [{"name": "capacity", "description": "Capacity of this pool, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.capacity", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "freeSpace", "description": "Free space in this pool, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.freeSpace", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "online", "description": "Flag indicating if this pool is online.\n0=Offline,\n1=Online", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.online", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "!= 1 1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "CommVault Storage Pool ##INSTANCE## on ##HOST## is currently offline (status code: ##VALUE##) placing the instance in a ##LEVEL## state.\n\nThis started at ##START## or ##DURATION## ago.\n\nStatus codes:\n\n0=Offline,\n1=Online"}, {"name": "usedPercent", "description": "Utilization percent.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.usedPercent", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "> 90 98 100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "CommVault Storage Pool ##INSTANCE## on ##HOST## is currently ##VALUE##% full placing the instance in a ##LEVEL## state.\n\nThis started at ##START## or ##DURATION## ago."}, {"name": "usedSpace", "description": "Used space, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.usedSpace", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Online Status", "title": "Online Status", "verticalLabel": "0=offline, 1=online", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "online", "datapointName": "online", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Status", "color": "orange", "datapointName": "online", "isVirtual": false}]}, {"name": "Utilization", "title": "Utilization", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "capacity", "datapointName": "capacity", "consolidationFn": "average"}, {"name": "freeSpace", "datapointName": "freeSpace", "consolidationFn": "average"}, {"name": "usedSpace", "datapointName": "usedSpace", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Capacity", "color": "gray", "datapointName": "capacity", "isVirtual": false}, {"type": "stack", "legend": "Free", "color": "olive", "datapointName": "freeSpace", "isVirtual": false}, {"type": "stack", "legend": "Used", "color": "silver", "datapointName": "usedSpace", "isVirtual": false}]}], "overviewGraphs": [{"name": "Highest Utilization Percent (Top 10)", "title": "Highest Utilization Percent (Top 10)", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "usedPercent", "datapointName": "usedPercent", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "usedPercent", "isVirtual": false}]}, {"name": "Largest Storage Pools (Top 10)", "title": "Largets Storage Pools", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "capacity", "datapointName": "capacity", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "capacity", "isVirtual": false}]}, {"name": "Total Storage Capacity", "title": "Total Storage Capacity", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": true, "scale1024": true, "rigid": false, "datapoints": [{"name": "capacity", "datapointName": "capacity", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "area", "legend": "Capacity", "color": "silver", "datapointName": "capacity", "isVirtual": false}]}]}

×DataSource: Microsoft_Office365_SharepointStorage (509)

{"name": "Microsoft_Office365_SharepointStorage", "description": "SharePoint site storage", "appliesTo": "hasCategory(\"Saas/Office365\")", "searchKeywords": "productivity,sharepoint,office,storage,microsoft,office 365", "displayedAs": "Office365 SharePoint Storage", "collectionInterval": "1h", "collectionMethod": "saasoffice365csvreport", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"reportName": "SharePointSiteUsageStorage"}, "datapoints": [{"name": "DataOffset", "description": "Difference in hours between the current time and the report time generated by Microsoft.", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Data Offset\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SiteType", "description": "The type of site", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Site Type\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "StorageUsed", "description": "Amount of storage used by the Sharepoint site.", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Storage Used (Byte)\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Data Offset", "title": "Data Offset", "verticalLabel": "hours", "min": 0.0, "displayPriority": 10, "timeScale": "1month", "scale1024": false, "rigid": false, "datapoints": [{"name": "DataOffset", "datapointName": "DataOffset", "consolidationFn": "average"}, {"name": "SiteType", "datapointName": "SiteType", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "DataOffset", "color": "silver", "datapointName": "DataOffset", "isVirtual": false}, {"type": "line", "legend": "SiteType", "color": "yellow", "datapointName": "SiteType", "isVirtual": false}]}, {"name": "Storage Used", "title": "Storage Used", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 10, "timeScale": "1month", "scale1024": true, "rigid": false, "datapoints": [{"name": "StorageUsed", "datapointName": "StorageUsed", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Storage Used", "color": "silver", "datapointName": "StorageUsed", "isVirtual": false}]}]}

×DataSource: Microsoft_Office365_UserCount (503)

{"name": "Microsoft_Office365_UserCount", "description": "Used to report the number of Active and inactive users for each Office 365 service.", "appliesTo": "hasCategory(\"Saas/Office365\")", "searchKeywords": "productivity,administration,office,microsoft,office 365", "displayedAs": "Office365 User Count", "collectionInterval": "1h", "collectionMethod": "saasoffice365csvreport", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"reportName": "Office365ServicesUserCounts"}, "datapoints": [{"name": "DataOffset", "description": "Difference in hours between the current time and the report time generated by Microsoft.", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Data Offset\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ExchangeActive", "description": "Active Exchange email users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Exchange Active\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ExchangeInactive", "description": "Inactive Exchange email users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Exchange Inactive\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Office365Active", "description": "Total office 365 active users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Office 365 Active\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Office365Inactive", "description": "Total office 365 inactive users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Office 365 Inactive\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OneDriveActive", "description": "Active users for OneDrive", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"OneDrive Active\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "OneDriveInactive", "description": "Inactive OneDrive users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"OneDrive Inactive\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0}, {"name": "SharePointActive", "description": "SharePoint active users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"SharePoint Active\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SharePointInactive", "description": "Number of inactive Sharepoint users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"SharePoint Inactive\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SkypeForBusinessActive", "description": "Skype active users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Skype For Business Active\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SkypeForBusinessInactive", "description": "Skype inactive users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Skype For Business Inactive\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TeamsActive", "description": "Teams active users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Teams Active\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TeamsInactive", "description": "Teams inactive users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Teams Inactive\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "YammerActive", "description": "Yammer active users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Yammer Active\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "YammerInactive", "description": "Yammer Inactive users", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"Yammer Inactive\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Active Users by Service", "title": "Active Users by Service", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DataOffset", "datapointName": "DataOffset", "consolidationFn": "average"}, {"name": "Exchange", "datapointName": "ExchangeActive", "consolidationFn": "average"}, {"name": "Office365", "datapointName": "Office365Active", "consolidationFn": "average"}, {"name": "OneDrive", "datapointName": "OneDriveActive", "consolidationFn": "average"}, {"name": "SharePoint", "datapointName": "SharePointActive", "consolidationFn": "average"}, {"name": "SkypeForBusiness", "datapointName": "SkypeForBusinessActive", "consolidationFn": "average"}, {"name": "Teams", "datapointName": "TeamsActive", "consolidationFn": "average"}, {"name": "Yammer", "datapointName": "YammerActive", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Data Offset", "color": "silver", "datapointName": "DataOffset", "isVirtual": false}, {"type": "line", "legend": "Exchange", "color": "blue", "datapointName": "Exchange", "isVirtual": false}, {"type": "line", "legend": "Office365", "color": "green", "datapointName": "Office365", "isVirtual": false}, {"type": "line", "legend": "OneDrive", "color": "red1", "datapointName": "OneDrive", "isVirtual": false}, {"type": "line", "legend": "SharePoint", "color": "orange", "datapointName": "SharePoint", "isVirtual": false}, {"type": "line", "legend": "Skype", "color": "yellow", "datapointName": "SkypeForBusiness", "isVirtual": false}, {"type": "line", "legend": "Teams", "color": "maroon", "datapointName": "Teams", "isVirtual": false}, {"type": "line", "legend": "Yammer", "color": "black", "datapointName": "Yammer", "isVirtual": false}]}, {"name": "Inactive Users by Service", "title": "Inactive Users by Service", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1month", "scale1024": false, "rigid": false, "datapoints": [{"name": "DataOffset", "datapointName": "DataOffset", "consolidationFn": "average"}, {"name": "ExchangeInactive", "datapointName": "ExchangeInactive", "consolidationFn": "average"}, {"name": "Office365Inactive", "datapointName": "Office365Inactive", "consolidationFn": "average"}, {"name": "OneDriveInactive", "datapointName": "OneDriveInactive", "consolidationFn": "average"}, {"name": "SharePointInactive", "datapointName": "SharePointInactive", "consolidationFn": "average"}, {"name": "SkypeForBusinessInactive", "datapointName": "SkypeForBusinessInactive", "consolidationFn": "average"}, {"name": "TeamsInactive", "datapointName": "TeamsInactive", "consolidationFn": "average"}, {"name": "YammerInactive", "datapointName": "YammerInactive", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Data Offset", "color": "silver", "datapointName": "DataOffset", "isVirtual": false}, {"type": "line", "legend": "Exchange", "color": "blue", "datapointName": "ExchangeInactive", "isVirtual": false}, {"type": "line", "legend": "Office365", "color": "green", "datapointName": "Office365Inactive", "isVirtual": false}, {"type": "line", "legend": "OneDrive", "color": "red1", "datapointName": "OneDriveInactive", "isVirtual": false}, {"type": "line", "legend": "SharePoint", "color": "orange", "datapointName": "SharePointInactive", "isVirtual": false}, {"type": "line", "legend": "Skype", "color": "yellow", "datapointName": "SkypeForBusinessInactive", "isVirtual": false}, {"type": "line", "legend": "Teams", "color": "maroon", "datapointName": "TeamsInactive", "isVirtual": false}, {"type": "line", "legend": "Yammer", "color": "black", "datapointName": "YammerInactive", "isVirtual": false}]}]}

×DataSource: NetSNMP_Memory_Usage_Solaris (804)

{"name": "NetSNMP_Memory_Usage_Solaris", "description": "Collects various Net-SNMP memory usage metrics on Solaris resources such as available, free, and used.", "appliesTo": "hasCategory(\"SolarisNetSNMP\")", "searchKeywords": "memory,netsnmp,snmp,solaris", "technicalNotes": "- Requires PropertySource addCategory_SolarisNetSNMP\n- 512 Block Size Used. Block Size can also be set via a custom property Solaris.BlockSize as well, Output Converts to Bytes\n- Cached memory pre-calcuated into AvailReal by Solaris\n- There is no OID that reports the scan rate, or the rates of paging in/out. So default SNMP won't work to report on these data.\n- Swap NetSNMP OID's report mostly 0's so they are not included", "displayedAs": "Memory Usage Solaris", "collectionInterval": "1m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.snmp.Snmp\n\ndef snmp_timeout = 15000\ndef props = hostProps.toProperties()\ndef hostname = hostProps.get(\"system.hostname\")\ndef BlockSize = hostProps.get(\"Solaris.BlockSize\")?: 512\ndef AvailReal = Snmp.get(hostname, \".1.3.6.1.4.1.2021.4.6.0\", props, snmp_timeout).toBigInteger()*BlockSize.toInteger()\ndef TotalReal = Snmp.get(hostname, \".1.3.6.1.4.1.2021.4.5.0\", props, snmp_timeout).toBigInteger()*BlockSize.toInteger()\n\n\nprintln \"AvailReal\" + \"=\" + AvailReal\nprintln \"TotalReal\" + \"=\" + TotalReal\n\ndef ActiveMemoryPercent = (100 * ((TotalReal - AvailReal) / TotalReal))\ndef UsedMemory = (TotalReal - AvailReal)\n\nprintln \"ActiveMemoryPercent\" + \"=\" + ActiveMemoryPercent\nprintln \"UsedMemory\" + \"=\" + UsedMemory\n\nreturn 0"}, "datapoints": [{"name": "ActiveMemoryPercent", "description": "Active memory percentage in use", "interpretMethod": "namevalue", "interpretExpr": "ActiveMemoryPercent", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "AvailReal", "description": "Real/physical memory currently unused or available", "interpretMethod": "namevalue", "interpretExpr": "AvailReal", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalReal", "description": "Total amount of real/physical memory installed on this host", "interpretMethod": "namevalue", "interpretExpr": "TotalReal", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UsedMemory", "description": "Amount of memory currently in use", "interpretMethod": "namevalue", "interpretExpr": "UsedMemory", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Memory Usage", "title": "Memory Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "AvailReal", "datapointName": "AvailReal", "consolidationFn": "average"}, {"name": "UsedMemory", "datapointName": "UsedMemory", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Available Real Memory", "color": "olive", "datapointName": "AvailReal", "isVirtual": false}, {"type": "stack", "legend": "Used Memory", "color": "red", "datapointName": "UsedMemory", "isVirtual": false}]}, {"name": "Percent Of Memory In Active Use", "title": "Percent Of Memory In Active Use", "verticalLabel": "%", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ActiveMemoryPercent", "datapointName": "ActiveMemoryPercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Percent Of Memory In Active Use", "color": "aqua", "datapointName": "ActiveMemoryPercent", "isVirtual": false}]}, {"name": "Total Real Memory Installed", "title": "Total Real Memory Installed", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "TotalReal", "datapointName": "TotalReal", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Total Real Memory", "color": "gray", "datapointName": "TotalReal", "isVirtual": false}]}]}

×DataSource: Cisco_DNAC_Devices (78)

{"name": "Cisco_DNAC_Devices", "description": "Health scores for Cisco DNAC devices including CPU, memory, interface, and reachability scores as well as issue counts.", "appliesTo": "hasCategory(\"Cisco_DNAC\")", "searchKeywords": "score,dnac,dna,health,cisco,device", "technicalNotes": "https://developer.cisco.com/docs/dna-center/#!api-devices-devices", "displayedAs": "Cisco DNAC Devices", "collectionInterval": "10m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\ndef collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\ndef modLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n\ndef lmDNAC = modLoader.load(\"cisco.dnac\", \"0\") // Load Cisco DNAC module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\ndef lmtopo = modLoader.load(\"lm.topo\", \"0\") // Load LM topo module\ndef lmtopoData = modLoader.load(\"lm.data.topo\", \"0\")\nlmtopoData.run()\n\n// Construct DNACSnippet class from snippet\ndef snip = lmDNAC.DNACSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\ndef response = snip.httpGet(\"device-health\", [\"limit\":1000])\ndef deviceDetails = snip.httpGet(\"network-device\")?.response // needed for topo\n\nif (response) {\n response.response.each{ device ->\n def wildvalue = device.ipAddress.replaceAll(/[#\\\\:= ]/,'_')\n\n Map ilps = [\n \"auto.cisco.dnac.device.model\" : device.model,\n \"auto.cisco.dnac.device.osVersion\" : device.osVersion,\n \"auto.cisco.dnac.device.ip\" : device.ipAddress,\n \"auto.cisco.dnac.device.mac\" : device.macAddress,\n \"auto.cisco.dnac.device.location\" : device.location,\n \"auto.cisco.dnac.device.family\" : device.deviceFamily,\n \"auto.cisco.dnac.device.type\" : device.deviceType,\n ]\n\n def eris = []\n def ert\n\n def mac = device.macAddress?.toLowerCase()\n\n if (lmtopo.isMac(mac, lmtopoData.blockedKeys, debug)) {\n eris << mac\n }\n\n // Get device id from network-device endpoint and set as ERI\n def devDetails = deviceDetails?.find { dev -> dev.macAddress == mac }\n if (devDetails) {\n if (devDetails.id) {\n eris << devDetails.id\n }\n\n if (!eris.isEmpty()) {\n ilps[\"predef.externalResourceId\"] = lmtopo.eriPreProcessor(eris, lmtopoData.blockedKeys, keyNamespace, keyBlacklist)\n\n // Determine ERT\n if (devDetails.role?.toLowerCase()?.contains(\"router\")) ert = \"Router\"\n if (ert == null && devDetails.type?.toLowerCase()?.contains(\"switch\")) ert = \"Switch\"\n if (ert == null && devDetails.type?.toLowerCase()?.contains(\"access point\")) ert = \"Router\"\n if (ert == null && devDetails.type?.toLowerCase()?.contains(\"wireless controller\")) ert = \"Router\"\n if (ert == null && devDetails.family?.toLowerCase()?.contains(\"switch\")) ert = \"Switch\"\n if (ert) ilps[\"predef.externalResourceType\"] = ert\n }\n }\n\n lmEmit.instance(wildvalue, device.name, device.location, ilps)\n }\n}\nelse {\n println \"Error occurred. Try debug mode\"\n return 1\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\ndef collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\ndef modLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n\ndef lmDNAC = modLoader.load(\"cisco.dnac\", \"0\") // Load Cisco DNAC module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct DNACSnippet class from snippet\ndef snip = lmDNAC.DNACSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\ndef reachabilityHealthStatuses = [\n \"REACHABLE\" : 1,\n \"UP\" : 2,\n \"REBOOTING\" : 3,\n \"UNREACHABLE\" : 4\n]\n\ndef response = snip.httpGet(\"device-health\", [\"limit\":1000])\n\nif (response) {\n response.response.each{ device ->\n def wildvalue = device[\"ipAddress\"].toString().replaceAll(/[#\\\\:= ]/,'_')\n\n lmEmit.dp(wildvalue, \"overallHealth\", device.overallHealth)\n lmEmit.dp(wildvalue, \"issueCount\", device.issueCount)\n lmEmit.dp(wildvalue, \"interfaceLinkErrHealth\", device.interfaceLinkErrHealth)\n lmEmit.dp(wildvalue, \"cpuHealth\", device.cpuHealth)\n lmEmit.dp(wildvalue, \"memoryUtilizationHealth\", device.memoryUtilizationHealth)\n lmEmit.dp(wildvalue, \"interDeviceLinkAvailHealth\", normalizeScore(device.interDeviceLinkAvailHealth))\n lmEmit.dp(wildvalue, \"interDeviceLinkAvailFabric\", device.interDeviceLinkAvailFabric)\n lmEmit.dp(wildvalue, \"reachabilityHealth\", reachabilityHealthStatuses.get(device.reachabilityHealth.toUpperCase(),-1))\n }\n}\nelse {\n println \"Error occurred. Try debug mode\"\n return 1\n}\n\nreturn 0\n\n\n/*\n * Helper function to normalize health scores\n */\ndef normalizeScore(value) {\n def val = value.toInteger()\n\n if (val <= 0) {\n return val\n }\n else {\n return val / 10\n }\n}"}, "datapoints": [{"name": "cpu", "description": "CPU health. Valid status are:\n\n0: Inactive, \n1-3: Poor, \n4-7: Fair, \n8-10: Good", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.cpuHealth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "10", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ifLinkErr", "description": "Interface link error health. Valid status are:\n\n0: Inactive, \n1-3: Poor, \n4-7: Fair, \n8-10: Good", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.interfaceLinkErrHealth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "10", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "interDeviceLinkAvail", "description": "Inter-device link availability health. Valid status are:\n\n0: Inactive, \n1-3: Poor, \n4-7: Fair, \n8-10: Good", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.interDeviceLinkAvailHealth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "10", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "interDeviceLinkAvailFabric", "description": "Inter-device link availability fabric health. Valid status are:\n\n0: Inactive, \n1-3: Poor, \n4-7: Fair, \n8-10: Good", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.interDeviceLinkAvailFabric", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "10", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "issueCount", "description": "Number of issues for this device.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.issueCount", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memory", "description": "Memory utilization health. Valid status are:\n\n0: Inactive, \n1-3: Poor, \n4-7: Fair, \n8-10: Good", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.memoryUtilizationHealth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "10", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "overall", "description": "Overall device health. Responses outside the values shown below indicate no data is available.\n\n1-3: Poor, \n4-7: Fair, \n8-10: Good", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.overallHealth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "1", "max": "10", "threshold": "<= 7 3", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertSubject": "DNA Center device reporting suboptimal health score", "alertBody": "DNA Center device ##INSTANCE## on ##HOST## is reporting ##VALUE##, placing the host into ##LEVEL## state.\n##DPDESCRIPTION##\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "reachability", "description": "Reachability health. Valid status are:\n\n-1: No Data returned from resource.\n1: Reachable\n2: Up\n3: Rebooting\n4: Unreachable", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.reachabilityHealth", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "= 4", "noData": "Do not trigger an alert", "triggerInterval": 1, "clearInterval": 0, "alertBody": "DNA Center device ##INSTANCE## on ##HOST## is reporting a reachability status of ##VALUE##. This indicates that this device can no longer be reached, placing the host into ##LEVEL## state.\n\nValid statuses are:\n\n-1: No Data returned from resource.\n1: Reachable\n2: Up\n3: Rebooting\n4: Unreachable\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "Health Scores", "title": "Health Scores", "verticalLabel": "score", "min": 0.0, "max": 10.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cpu", "datapointName": "cpu", "consolidationFn": "average"}, {"name": "ifLinkErr", "datapointName": "ifLinkErr", "consolidationFn": "average"}, {"name": "interDeviceLinkAvail", "datapointName": "interDeviceLinkAvail", "consolidationFn": "average"}, {"name": "interDeviceLinkAvailFabric", "datapointName": "interDeviceLinkAvailFabric", "consolidationFn": "average"}, {"name": "memory", "datapointName": "memory", "consolidationFn": "average"}, {"name": "overall", "datapointName": "overall", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "CPU", "color": "blue", "datapointName": "cpu", "isVirtual": false}, {"type": "line", "legend": "Interface Link Error", "color": "red", "datapointName": "ifLinkErr", "isVirtual": false}, {"type": "line", "legend": "Inter-device Link Availability", "color": "orange2", "datapointName": "interDeviceLinkAvail", "isVirtual": false}, {"type": "line", "legend": "Inter-device Link Availability Fabric", "color": "yellow", "datapointName": "interDeviceLinkAvailFabric", "isVirtual": false}, {"type": "line", "legend": "Memory", "color": "olive", "datapointName": "memory", "isVirtual": false}, {"type": "line", "legend": "Overall", "color": "black", "datapointName": "overall", "isVirtual": false}]}, {"name": "Issues", "title": "Issues", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "issueCount", "datapointName": "issueCount", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "Issues", "color": "orange", "datapointName": "issueCount", "isVirtual": false}]}, {"name": "Reachability", "title": "Reachability", "verticalLabel": "1=reachable, 2=up, 3=rebooting, 4=unreachable", "min": -2.0, "max": 5.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "reachability", "datapointName": "reachability", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Reachability", "color": "fuchsia", "datapointName": "reachability", "isVirtual": false}]}], "overviewGraphs": [{"name": "Issue Count by Device", "title": "Issue Count by Device", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "issueCount", "datapointName": "issueCount", "consolidationFn": "max", "aggregateMethod": "max"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "issueCount", "isVirtual": false}]}, {"name": "Overall Health by Device", "title": "Overall Health by Device", "verticalLabel": "score", "min": 0.0, "max": 10.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "overall", "datapointName": "overall", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "overall", "isVirtual": false}]}]}

×DataSource: SCP_Standard (2315)

{"name": "SCP_Standard", "description": "Common module for handling generic SCP config collection.\nThese configs will alert on a non-filtered change.", "appliesTo": "auto.config.type.scp", "group": "Common ConfigSources", "searchKeywords": "scp,configuration,ssh,networking,switch", "technicalNotes": "-Host Properties-\nssh.user\t\t\t: Username\nssh.pass\t\t\t: Password\nssh.publickey\t\t: Location of key (optional)\nssh.port\t\t\t: Port (optional)\nconfig.filter \t\t: Regex used to filter output. Can be used for removing MOTD messages or personal information. (optional)", "displayedAs": "Standard Configs (SCP)", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 2, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "// SCP Standard AD\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.util.Settings\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport net.schmizz.sshj.xfer.scp.ScpCommandLine\nimport net.schmizz.sshj.xfer.FileSystemFile\nimport net.schmizz.sshj.SSHClient\nimport java.security.MessageDigest\nimport groovy.json.JsonOutput\n\ndef version = hostProps.get(\"auto.config.version\", \"-1\")\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef cmds = hostProps.get(\"config.commands.standard\", hostProps.get(\"auto.config.commands.standard\", \"\")).split(\",\").flatten()\n\ndef time = Settings.getSettingInt(\"discover.script.timeoutInSec\", 300) * 1000\n\ndef success = false\n\ncmds.grep().each { command->\n\tdef (wild, alias) = command.split('=', 2) \n\n\tdef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\n\tdef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\n\tnew File(fileCache.getParent()).mkdirs()\n\n\tif(fileCache.exists()) {\n\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\t\tsuccess = true\n\t\treturn\n\t}\n\n\tdef startTime = System.currentTimeMillis()\n\n\tdef tmpDir = new File(\"/scp/${hostMD5}\")\n\ttmpDir.mkdirs()\n\n\tdef client = new SSHClient()\n\tclient.setTimeout(time)\n\tclient.setConnectTimeout(time)\n\tclient.addHostKeyVerifier(new PromiscuousVerifier())\n\n\ttry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\n\ttry {\n\t\tclient.connect(host, port.toInteger())\n\n\t\tif(pKey && new File(pKey).exists()) {\n\t\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t\t} else {\n\t\t\tclient.auth(user,\n\t\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\t\tnew AuthNone())\n\t\t}\n\n\t\tdef commandLine = ScpCommandLine.with(ScpCommandLine.Arg.SOURCE)\n\t\t\t\t\t\t\t\t\t\t.withPath(wild, ScpCommandLine.EscapeMode.NoEscape)\n\n\t\tdef downloadClient = client.newSCPFileTransfer().newSCPDownloadClient()\n\t\tdownloadClient.engine.cleanSlate()\n\t\tdownloadClient.engine.execSCPWith(commandLine)\n\t\tdownloadClient.engine.signal(\"Start status OK\")\n\n\t\tdef targetFile = new FileSystemFile(tmpDir)\n\t\tdef msg = \"\"\n\n\t\twhile (!(msg = downloadClient.engine.readMessage()).isEmpty()) {\n\t\t\tdownloadClient.process(downloadClient.engine.getTransferListener(), null, msg, targetFile)\n\t\t} \n\t}\n\tcatch (Exception ex) {\n\t\tprintln \"Exception: ${ex.message}\"\n\t}\n\tfinally {\n\t\tclient?.disconnect()\n\t}\n\n\tif(tmpDir.listFiles().length > 0) {\n\t\tdef output = tmpDir.listFiles().first().text.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.trim()\n\n\t\tif(sRgx && out =~ sRgx) {\n\t\t\tout = \"\"\n\t\t}\n\n\t\ttmpDir.deleteDir()\n\n\t\tif(output) {\n\t\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\t\t\tsuccess = true\n\n\t\t\tdef stats = [:]\n\t\t\tstats[\"type\"] = \"SCP\"\n\t\t\tstats[\"host\"] = host\n\t\t\tstats[\"wildvalue\"] = wild\n\t\t\tstats[\"time\"] = System.currentTimeMillis()\n\t\t\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\t\t\tstats[\"state\"] = \"SUCCESSFUL\"\n\n\t\t\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\t\t\tfileCache.write(json)\n\t\t}\n\t}\n}\n\nreturn success ? 0 : 1"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "// SCP Collection\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.util.script.ScriptCache\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport net.schmizz.sshj.xfer.scp.ScpCommandLine\nimport net.schmizz.sshj.xfer.FileSystemFile\nimport net.schmizz.sshj.SSHClient\nimport java.security.MessageDigest\nimport groovy.json.JsonOutput\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef wild = instanceProps.get(\"wildvalue\")\ndef version = instanceProps.get(\"auto.config.instance.version\", \"-1\")\n\nif(version != \"-1\" && version != hostProps.get(\"auto.config.version\", \"-1\")) {\n\tprintln \"Collecting the incorrect version. AD needs to run successfully at least once to update props.\"\n\treturn 1\n}\n\ndef time = (Settings.getSettingInt(\"configcollector.script.timeout\", 300) - 1) * 1000\n\ndef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\ndef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\nnew File(fileCache.getParent()).mkdirs()\n\ndef log = []\n\ndef stats = [:]\nstats[\"type\"] = \"SCP\"\nstats[\"host\"] = host\nstats[\"wildvalue\"] = wild\nstats[\"state\"] = \"FAILED\"\n\ndef md5 = MessageDigest.getInstance(\"MD5\").digest(\"${host}${port}${wild}\".bytes).encodeHex().toString()\n\ndef tmpDir = new File(\"/scp/${md5}\")\ntmpDir.mkdirs()\n\ndef startTime = System.currentTimeMillis()\n\ndef client = new SSHClient()\nclient.setTimeout(time)\nclient.setConnectTimeout(time)\nclient.addHostKeyVerifier(new PromiscuousVerifier())\n\ntry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\ntry {\n\tclient.connect(host, port.toInteger())\n\n\tif(pKey && new File(pKey).exists()) {\n\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t} else {\n\t\tclient.auth(user,\n\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\tnew AuthNone())\n\t}\n\n\tdef commandLine = ScpCommandLine.with(ScpCommandLine.Arg.SOURCE)\n\t\t\t\t\t\t\t\t\t.withPath(wild, ScpCommandLine.EscapeMode.NoEscape)\n\n\tdef downloadClient = client.newSCPFileTransfer().newSCPDownloadClient()\n\tdownloadClient.engine.cleanSlate()\n\tdownloadClient.engine.execSCPWith(commandLine)\n\tdownloadClient.engine.signal(\"Start status OK\")\n\n\tdef targetFile = new FileSystemFile(tmpDir)\n\tdef msg = \"\"\n\n\twhile (!(msg = downloadClient.engine.readMessage()).isEmpty()) {\n\t\tdownloadClient.process(downloadClient.engine.getTransferListener(), null, msg, targetFile)\n\t}\n\n\tlog.push(\"INFO : Download Finished\")\n}\ncatch (Exception ex) {\n\tlog.push(\"ERROR : Exception - ${ex.message}\")\n}\nfinally {\n\tclient?.disconnect()\n}\n\nif(tmpDir.listFiles().length > 0) {\n\tlog.push(\"INFO : Files Found\")\n\n\tdef rawOut = tmpDir.listFiles().first().text\n\tdef out = rawOut.replaceAll(cRgx, \"\")\n\t\t\t\t\t.replaceAll(fRgx, \"\")\n\t\t\t\t\t.trim()\n\n\tif(sRgx && out =~ sRgx) {\n\t\tout = \"\"\n\t}\n\n\tif(out) {\n\t\tprint out\n\t\tstats[\"state\"] = \"SUCCESSFUL\"\n\t\tstats[\"size\"] = out.length()\n\t}\n\n\tstats[\"rawSize\"] = rawOut.length()\n\n\ttmpDir.deleteDir()\n}\n\nstats[\"time\"] = System.currentTimeMillis()\nstats[\"duration\"] = System.currentTimeMillis() - startTime\nstats[\"log\"] = log\n\nif(stats[\"state\"] != \"SUCCESSFUL\") {\n\tprintln \"--- Collection Failure Log ---\"\n\tprint log.join(\"\\n\")\n}\n\ndef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\nfileCache.write(json)\n//ScriptCache.getCache().set(\"config.${hostMD5}.stats\", json)\n\nreturn stats[\"state\"] == \"SUCCESSFUL\" ? 0 : 1"}, "configChecks": [{"name": "Check", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": ["(1[0-9]|2[0-4]):\\d\\d?:\\d\\d:?\\d*.*[>#$]$", "(?i)^\\s*FREE MEMORY:.*", "(?i)^\\s*DAYS TO EXPIRATION", "(?i)^\\s*SET (PASSW(OR)?D)|(PSKSECRET)|(MD5-KEY)|(ENC)", "(?i)^#", "(?i)^.*UP(TIME)?\\s*(IS)?:?\\s*\\d+\\s*(YEAR|WEEK|DAY|HOUR|MINUTE)S?.*", "^!", "(?i)(MON|TUE|WED|THU|FRI|SAT|SUN) (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) \\d+ \\d+:\\d+\\d+:\\d+\\.?\\d* [A-Z]*", "(?i)USING \\d+ OUT OF \\d+ BYTES", "(?i)^SYSTEM RESTARTED AT", "(?i)UP\\s?TIME", "(?i)^CURRENT CONFIGURATION\\s*:", "(?i)^NTP CLOCK-PERIOD"], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": true}, "clearAfterAck": false, "clearAfterMin": 0}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: SFTP_Standard (2313)

{"name": "SFTP_Standard", "description": "Common module for handling generic SFTP config collection.\nThese configs will alert on a non-filtered change.", "appliesTo": "auto.config.type.sftp", "group": "Common ConfigSources", "searchKeywords": "configuration,ssh,networking,sftp,switch", "technicalNotes": "-Host Properties-\nssh.user\t\t\t: Username\nssh.pass\t\t\t: Password\nssh.publickey\t\t: Location of key (optional)\nssh.port\t\t\t: Port (optional)\nconfig.filter \t\t: Regex used to filter output. Can be used for removing MOTD messages or personal information. (optional)", "displayedAs": "Standard Configs (SFTP)", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 2, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "groovy", "content": "// SFTP Standard AD\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.util.Settings\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport net.schmizz.sshj.xfer.FileSystemFile\nimport net.schmizz.sshj.SSHClient\nimport java.security.MessageDigest\nimport groovy.json.JsonOutput\n\ndef version = hostProps.get(\"auto.config.version\", \"-1\")\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef cmds = hostProps.get(\"config.commands.standard\", hostProps.get(\"auto.config.commands.standard\", \"\")).split(\",\").flatten()\n\ndef time = Settings.getSettingInt(\"discover.script.timeoutInSec\", 300) * 1000\n\ndef success = false\n\ncmds.grep().each { command->\n\tdef (wild, alias) = command.split('=', 2) \n\n\tdef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\n\tdef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\n\tnew File(fileCache.getParent()).mkdirs()\n\n\tif(fileCache.exists()) {\n\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\t\tsuccess = true\n\t\treturn\n\t}\n\n\tdef startTime = System.currentTimeMillis()\n\n\tdef tmpDir = new File(\"/sftp/${hostMD5}\")\n\ttmpDir.mkdirs()\n\n\tdef sftp = null\n\tdef client = new SSHClient()\n\tclient.setTimeout(time)\n\tclient.setConnectTimeout(time)\n\tclient.addHostKeyVerifier(new PromiscuousVerifier())\n\n\ttry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\n\ttry {\n\t\tclient.connect(host, port.toInteger())\n\n\t\tif(pKey && new File(pKey).exists()) {\n\t\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t\t} else {\n\t\t\tclient.auth(user,\n\t\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\t\tnew AuthNone())\n\t\t}\n\n\t\tdef targetFile = new FileSystemFile(tmpDir)\n\n\t\tsftp = client.newSFTPClient()\n\t\tsftp.get(wild, targetFile)\n\t}\n\tcatch (Exception ex) {\n\t\tprintln \"Exception: ${ex.message}\"\n\t}\n\tfinally {\n\t\tsftp?.close()\n\t\tclient?.disconnect()\n\t}\n\n\tif(tmpDir.listFiles().length > 0) {\n\t\tdef output = tmpDir.listFiles().first().text.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.trim()\n\n\t\tif(sRgx && out =~ sRgx) {\n\t\t\tout = \"\"\n\t\t}\n\n\t\ttmpDir.deleteDir()\n\n\t\tif(output) {\n\t\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\t\t\tsuccess = true\n\t\t\t\n\t\t\tdef stats = [:]\n\t\t\tstats[\"type\"] = \"SFTP\"\n\t\t\tstats[\"host\"] = host\n\t\t\tstats[\"wildvalue\"] = wild\n\t\t\tstats[\"time\"] = System.currentTimeMillis()\n\t\t\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\t\t\tstats[\"state\"] = \"SUCCESSFUL\"\n\n\t\t\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\t\t\tfileCache.write(json)\n\t\t}\n\t}\n}\n\nreturn success ? 0 : 1"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "// SFTP Collection\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.util.Settings\nimport com.santaba.agent.util.script.ScriptCache\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport net.schmizz.sshj.xfer.FileSystemFile\nimport net.schmizz.sshj.SSHClient\nimport java.security.MessageDigest\nimport groovy.json.JsonOutput\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef wild = instanceProps.get(\"wildvalue\")\ndef version = instanceProps.get(\"auto.config.instance.version\", \"-1\")\n\nif(version != \"-1\" && version != hostProps.get(\"auto.config.version\", \"-1\")) {\n\tprintln \"Collecting the incorrect version. AD needs to run successfully at least once to update props.\"\n\treturn 1\n}\n\ndef time = (Settings.getSettingInt(\"configcollector.script.timeout\", 300) - 1) * 1000\n\ndef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\ndef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\nnew File(fileCache.getParent()).mkdirs()\n\ndef log = []\n\ndef stats = [:]\nstats[\"type\"] = \"SFTP\"\nstats[\"host\"] = host\nstats[\"wildvalue\"] = wild\nstats[\"state\"] = \"FAILED\"\n\ndef md5 = MessageDigest.getInstance(\"MD5\").digest(\"${host}${port}${wild}\".bytes).encodeHex().toString()\n\ndef tmpDir = new File(\"/sftp/${md5}\")\ntmpDir.mkdirs()\n\ndef startTime = System.currentTimeMillis()\n\ndef sftp = null\ndef client = new SSHClient()\nclient.setTimeout(time)\nclient.setConnectTimeout(time)\nclient.addHostKeyVerifier(new PromiscuousVerifier())\n\ntry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\ntry {\n\tclient.connect(host, port.toInteger())\n\n\tif(pKey && new File(pKey).exists()) {\n\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t} else {\n\t\tclient.auth(user,\n\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\tnew AuthNone())\n\t}\n\n\tdef targetFile = new FileSystemFile(tmpDir)\n\n\tsftp = client.newSFTPClient()\n\tsftp.get(wild, targetFile)\n\tlog.push(\"INFO : Download Finished\")\n}\ncatch (Exception ex) {\n\tlog.push(\"ERROR : Exception - ${ex.message}\")\n}\nfinally {\n\tsftp?.close()\n\tclient?.disconnect()\n}\n\nif(tmpDir.listFiles().length > 0) {\n\tlog.push(\"INFO : Files Found\")\n\n\tdef rawOut = tmpDir.listFiles().first().text\n\tdef out = rawOut.replaceAll(cRgx, \"\")\n\t\t\t\t\t.replaceAll(fRgx, \"\")\n\t\t\t\t\t.trim()\n\n\tif(sRgx && out =~ sRgx) {\n\t\tout = \"\"\n\t}\n\n\tif(out) {\n\t\tprint out\n\t\tstats[\"state\"] = \"SUCCESSFUL\"\n\t\tstats[\"size\"] = out.length()\n\t}\n\n\tstats[\"rawSize\"] = rawOut.length()\n\n\ttmpDir.deleteDir()\n}\n\nstats[\"time\"] = System.currentTimeMillis()\nstats[\"duration\"] = System.currentTimeMillis() - startTime\nstats[\"log\"] = log\n\nif(stats[\"state\"] != \"SUCCESSFUL\") {\n\tprintln \"--- Collection Failure Log ---\"\n\tprint log.join(\"\\n\")\n}\n\ndef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\nfileCache.write(json)\n//ScriptCache.getCache().set(\"config.${hostMD5}.stats\", json)\n\nreturn stats[\"state\"] == \"SUCCESSFUL\" ? 0 : 1"}, "configChecks": [{"name": "Check", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": ["(1[0-9]|2[0-4]):\\d\\d?:\\d\\d:?\\d*.*[>#$]$", "(?i)^\\s*FREE MEMORY:.*", "(?i)^\\s*DAYS TO EXPIRATION", "(?i)^\\s*SET (PASSW(OR)?D)|(PSKSECRET)|(MD5-KEY)|(ENC)", "(?i)^#", "(?i)^.*UP(TIME)?\\s*(IS)?:?\\s*\\d+\\s*(YEAR|WEEK|DAY|HOUR|MINUTE)S?.*", "^!", "(?i)(MON|TUE|WED|THU|FRI|SAT|SUN) (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) \\d+ \\d+:\\d+\\d+:\\d+\\.?\\d* [A-Z]*", "(?i)USING \\d+ OUT OF \\d+ BYTES", "(?i)^SYSTEM RESTARTED AT", "(?i)UP\\s?TIME", "(?i)^CURRENT CONFIGURATION\\s*:", "(?i)^NTP CLOCK-PERIOD"], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": true}, "clearAfterAck": false, "clearAfterMin": 0}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: SSH_Exec_Dynamic (2312)

{"name": "SSH_Exec_Dynamic", "description": "Common module for handling generic SSH EXEC config collection.\nDynamic configs are set to not alert on change by default.", "appliesTo": "auto.config.type.exec", "group": "Common ConfigSources", "searchKeywords": "configuration,ssh,networking,switch", "technicalNotes": "-Host Properties-\nssh.user\t\t\t: Username\nssh.pass\t\t\t: Password\nssh.publickey\t\t: Location of key (optional)\nssh.port\t\t\t: Port (optional)\nconfig.filter \t\t: Regex used to filter output. Can be used for removing MOTD messages or personal information. (optional)", "displayedAs": "Dynamic Configs (SSH Exec)", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 2, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "// SSH Exec Dynamic AD\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.util.Settings\nimport net.schmizz.sshj.SSHClient\nimport net.schmizz.sshj.connection.channel.direct.Session\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport java.util.concurrent.TimeUnit\nimport java.security.MessageDigest\nimport groovy.json.JsonOutput\n\ndef version = hostProps.get(\"auto.config.version\", \"-1\")\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef pipe = hostProps.get(\"auto.config.commands.pipe\", \"\")\ndef cmds = hostProps.get(\"config.commands.dynamic\", hostProps.get(\"auto.config.commands.dynamic\", \"\")).split(\",\").flatten()\n\ndef time = Settings.getSettingInt(\"discover.script.timeoutInSec\", 300) * 1000\n\ndef success = false\n\ncmds.grep().each { command->\n\tdef (wild, alias) = command.split('=', 2)\n\n\twild += pipe\n\t\n\tdef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\n\tdef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\n\tnew File(fileCache.getParent()).mkdirs()\n\n\tif(fileCache.exists()) {\n\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\t\tsuccess = true\n\t\treturn\n\t}\n\n\tdef startTime = System.currentTimeMillis()\n\n\tdef client = new SSHClient()\n\tclient.setTimeout(time)\n\tclient.setConnectTimeout(time)\n\tclient.addHostKeyVerifier(new PromiscuousVerifier())\n\n\ttry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\n\tdef session\n\n\ttry {\n\t\tclient.connect(host, port.toInteger())\n\n\t\tif(pKey && new File(pKey).exists()) {\n\t\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t\t} else {\n\t\t\tclient.auth(user,\n\t\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\t\tnew AuthNone())\n\t\t}\n\n\t\tsession = client.startSession()\n\t\tsession.allocateDefaultPTY()\n\n\t\tdef cmd = session.exec(wild)\n\t\tcmd.join(time.toInteger(), TimeUnit.MILLISECONDS)\n\t\tcmd.close()\n\t\n\t\tdef out = cmd.getInputStream().text\n\t\t\t\t\t\t\t\t\t .replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t .trim()\n\n\t\tif(sRgx && out =~ sRgx) {\n\t\t\tout = \"\"\n\t\t}\n\n\t\tif(out) {\n\t\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\t\t\tsuccess = true\n\n\t\t\tdef stats = [:]\n\t\t\tstats[\"type\"] = \"EXEC\"\n\t\t\tstats[\"host\"] = host\n\t\t\tstats[\"wildvalue\"] = wild\n\t\t\tstats[\"time\"] = System.currentTimeMillis()\n\t\t\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\t\t\tstats[\"state\"] = \"SUCCESSFUL\"\n\n\t\t\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\t\t\tfileCache.write(json)\n\t\t}\n\t}\n\tcatch (Exception ex) {\n\t\tprintln \"Exception: ${ex.message}\"\n\t}\n\tfinally {\n\t\tsession?.close()\n\t\tclient?.disconnect()\n\t}\n}\n\nreturn success ? 0 : 1"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "// SSH Exec Collection\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n//import com.santaba.agent.util.script.ScriptCache\nimport com.santaba.agent.util.Settings\nimport net.schmizz.sshj.SSHClient\nimport net.schmizz.sshj.connection.channel.direct.Session\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport java.util.concurrent.TimeUnit\nimport java.security.MessageDigest\nimport groovy.json.JsonOutput\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef wild = instanceProps.get(\"wildvalue\")\ndef version = instanceProps.get(\"auto.config.instance.version\", \"-1\")\n\nif(version != \"-1\" && version != hostProps.get(\"auto.config.version\", \"-1\")) {\n\tprintln \"Collecting the incorrect version. AD needs to run successfully at least once to update props.\"\n\treturn 1\n}\n\ndef time = (Settings.getSettingInt(\"configcollector.script.timeout\", 300) - 1) * 1000\n\ndef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\ndef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\nnew File(fileCache.getParent()).mkdirs()\n\ndef log = []\n\ndef stats = [:]\nstats[\"type\"] = \"EXEC\"\nstats[\"host\"] = host\nstats[\"wildvalue\"] = wild\nstats[\"state\"] = \"FAILED\"\n\ndef startTime = System.currentTimeMillis()\n\ndef client = new SSHClient()\nclient.setTimeout(time)\nclient.setConnectTimeout(time)\nclient.addHostKeyVerifier(new PromiscuousVerifier())\n\ntry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\ndef session\n\ntry {\n\tclient.connect(host, port.toInteger())\n\n\tif(pKey && new File(pKey).exists()) {\n\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t} else {\n\t\tclient.auth(user,\n\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\tnew AuthNone())\n\t}\n\n\tsession = client.startSession()\n\tsession.allocateDefaultPTY()\n\n\tlog.push(\"INFO : Sending command\")\n\n\tdef cmd = session.exec(wild)\n\tcmd.join(time.toInteger(), TimeUnit.MILLISECONDS)\n\tcmd.close()\n\n\tlog.push(\"INFO : Command finished\")\n\n\tdef rawOut = cmd.getInputStream().text\n\tdef out = rawOut.replaceAll(cRgx, \"\")\n\t\t\t\t\t.replaceAll(fRgx, \"\")\n\t\t\t\t\t.trim()\n\n\tif(sRgx && out =~ sRgx) {\n\t\tout = \"\"\n\t}\n\n\tif(out) {\n\t\tprint out\n\n\t\tstats[\"state\"] = \"SUCCESSFUL\"\n\t\tstats[\"size\"] = out.length()\n\t}\n\n\tstats[\"rawSize\"] = rawOut.length()\n}\ncatch (Exception ex) {\n\tlog.push(\"ERROR : Exception - ${ex.message}\")\n}\nfinally {\n\tsession?.close()\n\tclient?.disconnect()\n\t\n\tstats[\"time\"] = System.currentTimeMillis()\n\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\tstats[\"log\"] = log\n\n\tif(stats[\"state\"] != \"SUCCESSFUL\") {\n\t\tprintln \"--- Collection Failure Log ---\"\n\t\tprint log.join(\"\\n\")\n\t}\n\n\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\tfileCache.write(json)\n\t//ScriptCache.getCache().set(\"config.${hostMD5}.stats\", json)\n\n\treturn stats[\"state\"] == \"SUCCESSFUL\" ? 0 : 1\n}"}, "configChecks": [{"name": "NoAlert", "description": "", "type": "groovy", "attrs": {"script": "// Dynamic configs are expected to change frequently.\n// A groovy script check allows the config to update without firing an alert.\nreturn 0"}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: SSH_Exec_Standard (2311)

{"name": "SSH_Exec_Standard", "description": "Common module for handling generic SSH EXEC config collection.\nThese configs will alert on a non-filtered change.", "appliesTo": "auto.config.type.exec", "group": "Common ConfigSources", "searchKeywords": "configuration,ssh,networking,switch", "technicalNotes": "-Host Properties-\nssh.user\t\t\t: Username\nssh.pass\t\t\t: Password\nssh.publickey\t\t: Location of key (optional)\nssh.port\t\t\t: Port (optional)\nconfig.filter \t\t: Regex used to filter output. Can be used for removing MOTD messages or personal information. (optional)", "displayedAs": "Standard Configs (SSH Exec)", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 2, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "// SSH Exec Standard AD\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.util.Settings\nimport net.schmizz.sshj.SSHClient\nimport net.schmizz.sshj.connection.channel.direct.Session\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport java.util.concurrent.TimeUnit\nimport java.security.MessageDigest\nimport groovy.json.JsonOutput\n\ndef version = hostProps.get(\"auto.config.version\", \"-1\")\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef pipe = hostProps.get(\"auto.config.commands.pipe\", \"\")\ndef cmds = hostProps.get(\"config.commands.standard\", hostProps.get(\"auto.config.commands.standard\", \"\")).split(\",\").flatten()\n\ndef time = Settings.getSettingInt(\"discover.script.timeoutInSect\", 300) * 1000\n\ndef success = false\n\ncmds.grep().each { command->\n\tdef (wild, alias) = command.split('=', 2)\n\n\twild += pipe\n\t\n\tdef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\n\tdef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\n\tnew File(fileCache.getParent()).mkdirs()\n\n\tif(fileCache.exists()) {\n\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\t\tsuccess = true\n\t\treturn\n\t}\n\n\tdef startTime = System.currentTimeMillis()\n\n\tdef client = new SSHClient()\n\tclient.setTimeout(time)\n\tclient.setConnectTimeout(time)\n\tclient.addHostKeyVerifier(new PromiscuousVerifier())\n\n\ttry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\n\tdef session\n\n\ttry {\n\t\tclient.connect(host, port.toInteger())\n\n\t\tif(pKey && new File(pKey).exists()) {\n\t\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t\t} else {\n\t\t\tclient.auth(user,\n\t\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\t\tnew AuthNone())\n\t\t}\n\n\t\tsession = client.startSession()\n\t\tsession.allocateDefaultPTY()\n\n\t\tdef cmd = session.exec(wild)\n\t\tcmd.join(time.toInteger(), TimeUnit.MILLISECONDS)\n\t\tcmd.close()\n\t\n\t\tdef out = cmd.getInputStream().text\n\t\t\t\t\t\t\t\t\t .replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t .trim()\n\n\t\tif(sRgx && out =~ sRgx) {\n\t\t\tout = \"\"\n\t\t}\n\n\t\tif(out) {\n\t\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\t\t\tsuccess = true\n\n\t\t\tdef stats = [:]\n\t\t\tstats[\"type\"] = \"EXEC\"\n\t\t\tstats[\"host\"] = host\n\t\t\tstats[\"wildvalue\"] = wild\n\t\t\tstats[\"time\"] = System.currentTimeMillis()\n\t\t\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\t\t\tstats[\"state\"] = \"SUCCESSFUL\"\n\n\t\t\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\t\t\tfileCache.write(json)\n\t\t}\n\t}\n\tcatch (Exception ex) {\n\t\tprintln \"Exception: ${ex.message}\"\n\t}\n\tfinally {\n\t\tsession?.close()\n\t\tclient?.disconnect()\n\t}\n}\n\nreturn success ? 0 : 1"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "// SSH Exec Collection\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n//import com.santaba.agent.util.script.ScriptCache\nimport com.santaba.agent.util.Settings\nimport net.schmizz.sshj.SSHClient\nimport net.schmizz.sshj.connection.channel.direct.Session\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport java.util.concurrent.TimeUnit\nimport java.security.MessageDigest\nimport groovy.json.JsonOutput\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef wild = instanceProps.get(\"wildvalue\")\ndef version = instanceProps.get(\"auto.config.instance.version\", \"-1\")\n\nif(version != \"-1\" && version != hostProps.get(\"auto.config.version\", \"-1\")) {\n\tprintln \"Collecting the incorrect version. AD needs to run successfully at least once to update props.\"\n\treturn 1\n}\n\ndef time = (Settings.getSettingInt(\"configcollector.script.timeout\", 300) - 1) * 1000\n\ndef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\ndef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\nnew File(fileCache.getParent()).mkdirs()\n\ndef log = []\n\ndef stats = [:]\nstats[\"type\"] = \"EXEC\"\nstats[\"host\"] = host\nstats[\"wildvalue\"] = wild\nstats[\"state\"] = \"FAILED\"\n\ndef startTime = System.currentTimeMillis()\n\ndef client = new SSHClient()\nclient.setTimeout(time)\nclient.setConnectTimeout(time)\nclient.addHostKeyVerifier(new PromiscuousVerifier())\n\ntry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\ndef session\n\ntry {\n\tclient.connect(host, port.toInteger())\n\n\tif(pKey && new File(pKey).exists()) {\n\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t} else {\n\t\tclient.auth(user,\n\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\tnew AuthNone())\n\t}\n\n\tsession = client.startSession()\n\tsession.allocateDefaultPTY()\n\n\tlog.push(\"INFO : Sending command\")\n\n\tdef cmd = session.exec(wild)\n\tcmd.join(time.toInteger(), TimeUnit.MILLISECONDS)\n\tcmd.close()\n\n\tlog.push(\"INFO : Command finished\")\n\n\tdef rawOut = cmd.getInputStream().text\n\tdef out = rawOut.replaceAll(cRgx, \"\")\n\t\t\t\t\t.replaceAll(fRgx, \"\")\n\t\t\t\t\t.trim()\n\n\tif(sRgx && out =~ sRgx) {\n\t\tout = \"\"\n\t}\n\n\tif(out) {\n\t\tprint out\n\n\t\tstats[\"state\"] = \"SUCCESSFUL\"\n\t\tstats[\"size\"] = out.length()\n\t}\n\n\tstats[\"rawSize\"] = rawOut.length()\n}\ncatch (Exception ex) {\n\tlog.push(\"ERROR : Exception - ${ex.message}\")\n}\nfinally {\n\tsession?.close()\n\tclient?.disconnect()\n\t\n\tstats[\"time\"] = System.currentTimeMillis()\n\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\tstats[\"log\"] = log\n\n\tif(stats[\"state\"] != \"SUCCESSFUL\") {\n\t\tprintln \"--- Collection Failure Log ---\"\n\t\tprint log.join(\"\\n\")\n\t}\n\n\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\tfileCache.write(json)\n\t//ScriptCache.getCache().set(\"config.${hostMD5}.stats\", json)\n\n\treturn stats[\"state\"] == \"SUCCESSFUL\" ? 0 : 1\n}"}, "configChecks": [{"name": "Check", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": ["(1[0-9]|2[0-4]):\\d\\d?:\\d\\d:?\\d*.*[>#$]$", "(?i)^\\s*FREE MEMORY:.*", "(?i)^\\s*DAYS TO EXPIRATION", "(?i)^\\s*SET (PASSW(OR)?D)|(PSKSECRET)|(MD5-KEY)|(ENC)", "(?i)^#", "(?i)^.*UP(TIME)?\\s*(IS)?:?\\s*\\d+\\s*(YEAR|WEEK|DAY|HOUR|MINUTE)S?.*", "^!", "(?i)(MON|TUE|WED|THU|FRI|SAT|SUN) (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) \\d+ \\d+:\\d+\\d+:\\d+\\.?\\d* [A-Z]*", "(?i)USING \\d+ OUT OF \\d+ BYTES", "(?i)^SYSTEM RESTARTED AT", "(?i)UP\\s?TIME", "(?i)^CURRENT CONFIGURATION\\s*:", "(?i)^NTP CLOCK-PERIOD"], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": true}, "clearAfterAck": false, "clearAfterMin": 0}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: SSH_Interactive_Dynamic (2320)

{"name": "SSH_Interactive_Dynamic", "description": "Common module for handling generic SSH Interactive config collection.\nDynamic configs are set to not alert on change by default.", "appliesTo": "auto.config.type.interactive", "group": "Common ConfigSources", "searchKeywords": "configuration,ssh,networking,switch", "technicalNotes": "-Host Properties-\nssh.user\t\t\t: Username\nssh.pass\t\t\t: Password\nssh.publickey\t\t: Location of key (optional)\nssh.port\t\t\t: Port (optional)\nssh.enable.pass\t: Privilege escalation password (optional)\nconfig.filter \t\t: Regex used to filter output. Can be used for removing MOTD messages or personal information. (optional)", "displayedAs": "Dynamic Configs (SSH Interactive)", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 2, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "// SSH Interactive Dynamic AD\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/ \nimport com.santaba.agent.util.Settings\nimport net.schmizz.sshj.SSHClient\nimport net.schmizz.sshj.common.SecurityUtils\nimport net.schmizz.sshj.connection.channel.Channel\nimport net.schmizz.sshj.connection.channel.direct.PTYMode\nimport net.schmizz.sshj.connection.channel.direct.Session\nimport net.schmizz.sshj.connection.channel.direct.Session.Shell\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport java.security.MessageDigest\nimport groovy.json.JsonSlurper\nimport groovy.json.JsonOutput\n\ndef version = hostProps.get(\"auto.config.version\", \"-1\")\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef pipe = hostProps.get(\"auto.config.commands.pipe\", \"\")\ndef fmtc = hostProps.get(\"config.commands.formatting\", hostProps.get(\"auto.config.commands.formatting\", \"\")).tokenize(\",\")\ndef endc = hostProps.get(\"auto.config.commands.end\", \"exit\").tokenize(\",\")\ndef cmds = hostProps.get(\"config.commands.dynamic\", hostProps.get(\"auto.config.commands.dynamic\", \"\")).split(\",\").flatten()\n\ndef customPrompt = hostProps.get(\"config.prompt\", hostProps.get(\"auto.config.prompt\", \"\"))\ndef pty = hostProps.get(\"config.pty\", hostProps.get(\"auto.config.pty\", \"vt100\"))\n\ndef escalationCommand = hostProps.get(\"auto.config.escalation.command\", \"enable\")\n\ndef enblePass = hostProps.get(\"ssh.enable.pass\", hostProps.get(\"config.enable.pass\", \"\"))\ndef loginPass = hostProps.get(\"ssh.login.pass\", hostProps.get(\"config.login.pass\", \"\"))\n\ndef promptFilter = hostProps.get(\"ssh.prompt.filter\", \"true\") ==~ \"1|true\"\n\n// Accepts strings in the format LINE_REGEX=>RESPONSE seperated by commas to be acted upon.\ndef customLineResponse = hostProps.get(\"config.custom.response\", \"\")\n\t\t\t\t\t\t\t\t .split(\",\")\n\t\t\t\t\t\t\t\t .collectEntries { it.tokenize(\"=>\").with { [(it[0]):it[1]] }}\n\t\t\t\t\t\t\t\t .findAll{ it.value != null }\n\ndef promptMaxSize = hostProps.get(\"config.prompt.maxsize\", \"64\").toInteger() // A sanity check when looking for a prompt.\n\ndef connectTimeout = 30000 // Timeout attempting a connection.\ndef readingTimeout = 60000 // Timeout waiting on data.\ndef maximumTimeout = (Settings.getSettingInt(\"discover.script.timeoutInSec\", 300) - 10) * 1000 // The maximum time to attempt collection.\n\nenum States {\n\tRUNNING, FAILED, SUCCESSFUL, INVALID, PARTIAL\n}\n\ndef ansiEscapeRegex = /[\\u001B\\u009B][\\[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))/\ndef newLineCharacters = [\"\\n\", \"\\r\", \"\\u001b[J\", \"\\u001b[1J\", \"\\u001b[2J\", \"\\u001b[K\", \"\\u001b[1K\", \"\\u001b[2K\"]\n\ndef log = []\ndef gotOutput = false\n\n// By shuffling the potential instances, we eventually allow for each to get the full timeout period.\nCollections.shuffle(cmds)\n\ncmds.grep().each { it->\n\tdef (wild, alias) = it.split('=', 2)\n\t\n\twild += pipe\n\n\tdef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\n\tdef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\n\tnew File(fileCache.getParent()).mkdirs()\n\t\n\tif(fileCache.exists()) {\n\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\t\tgotOutput = true\n\t\treturn\n\t}\n\n\tdef stats = [:]\n\tstats[\"type\"] = \"INTERACTIVE\"\n\tstats[\"host\"] = host\n\tstats[\"wildvalue\"] = wild\n\n\tdef client = new SSHClient()\n\tclient.setTimeout(maximumTimeout)\n\tclient.setConnectTimeout(connectTimeout)\n\tclient.addHostKeyVerifier(new PromiscuousVerifier())\n\n\ttry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\n\tdef state = States.RUNNING\n\tdef session = null\n\tdef shell = null\n\n\ttry {\n\t\tlog.push(\"INFO : Connecting to [${host}]\")\n\t\tclient.connect(host, port.toInteger())\n\n\t\tif(pKey && new File(pKey).exists()) {\n\t\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t\t} else {\n\t\t\tclient.auth(user,\n\t\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\t\tnew AuthNone())\n\t\t}\n\n\t\tsession = client.startSession()\n\t\tlog.push(\"INFO : Allocating [${pty}] Pseudoterminal\")\n \tsession.allocatePTY(pty, 80, 24, 0, 0, Collections.<PTYMode, Integer> emptyMap());\n\n\t\tdef startTime = System.currentTimeMillis()\n\n\t\tshell = session.startShell()\n\n\t\tdef txStream = new PrintStream(shell.getOutputStream(), true)\n\t\tdef rxStream = shell.getInputStream()\n\n\t\tdef ansiMode = false\n\t\tdef cursor = 0\n\t\tdef inputData = new byte[Math.max(5242880, Settings.getSettingInt(Settings.CONFIGURATION_MAX_LENGTH, 5242880))]\n\n\t\tdef prompt = customPrompt ?: \"\"\n\t\tdef enablePrompt = \"\"\n\t\tdef promptIndex = -1\n\t\tdef promptValidated = false\n\t\tdef filteredPrompt = false\n\t\t\n\t\tdef stdout = \"\"\n\n\t\tdef formattingCommands = fmtc\n\t\tdef collectingCommands = [wild]\n\t\tdef escalationCommands = enblePass ? [escalationCommand] : []\n\t\tdef extraLoginCommands = loginPass ? [\"login\"] : []\n\t\tdef credentialCommands = [pass] // Used to store auth crednetials so we don't attempt them multiple times\n\n\t\tdef lastCollectionCommand = \"\"\n\t\tdef lastCollectionIndex = -1\n\t\tdef lastSize = -1\n\n\t\twhile(state == States.RUNNING) {\n\t\t\tdef availableBytes = rxStream.available()\n\n\t\t\tif(availableBytes > 0) {\n\t\t\t\tif(cursor + availableBytes >= inputData.length) {\n\t\t\t\t\tlog.push(\"ERROR : Size of output greater than configured maximum\")\n\t\t\t\t\tstats[\"rawSize\"] = cursor + availableBytes\n\t\t\t\t\tstate = States.PARTIAL // We may want to set this to failed in some circumstance\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tcursor += rxStream.read(inputData, cursor, Math.min(availableBytes, inputData.length - cursor))\n\n\t\t\t\tstdout = new String(inputData[0..<cursor] as byte[])\n\n\t\t\t\tdef endLineIndex = 0\n\t\t\t\tdef endLineSize = 0\n\n\t\t\t\tnewLineCharacters.each { lineEnd->\n\t\t\t\t\tdef lineEndIndexCheck = stdout.lastIndexOf(lineEnd)\n\n\t\t\t\t\tif(lineEndIndexCheck > endLineIndex &&\n\t\t\t\t\t lineEndIndexCheck + lineEnd.length() < stdout.size()) {\n\t\t\t\t\t\tendLineIndex = lineEndIndexCheck\n\t\t\t\t\t\tendLineSize = lineEnd.length()\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(stdout.size() != lastSize) {\n\t\t\t\t\tlastSize = stdout.size()\n\t\t\t\t\tdef lastLn = stdout.substring(endLineIndex + endLineSize)\n\n\t\t\t\t\tif(ansiMode || lastLn.contains(\"\\u001b\")) {\n\t\t\t\t\t\tif(!ansiMode) {\n\t\t\t\t\t\t\tansiMode = true\n\t\t\t\t\t\t\tlog.push(\"INFO : Entering ANSI mode\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastLn = lastLn.replaceAll(ansiEscapeRegex,\"\")\n\t\t\t\t\t}\n\n\t\t\t\t\tlastLn = lastLn.trim()\n\n\t\t\t\t\tif(filteredPrompt && lastLn ==~ /.*\\d+:\\d+:\\d+:.*/) { // If times may be involved, strip all times from line\n\t\t\t\t\t\tlog.push(\"INFO : Line [${lastLn}] needs edit for filtered prompt\")\n\t\t\t\t\t\tlastLn = lastLn.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\t\tlog.push(\"INFO : Line changed to ${lastLn}\")\n\t\t\t\t\t}\n\n\t\t\t\t\tdef isPrompt = false\n\t\n\t\t\t\t\tif(lastLn ==~ /(?i)^(PLEASE ENTER LOGIN NAME|USER\\s?(NAME)?)\\s*:.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : User Line\")\n\t\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Username\")\n\t\t\t\t\t\t\ttxStream.print(\"${user}\\n\")\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(lastLn ==~ /(?i)^(PLEASE ENTER )?PASS(WORD)?\\s*:.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : Pass Line\")\n\t\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\t\tif(credentialCommands) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Sending Password\")\n\t\t\t\t\t\t\t\ttxStream.print(\"${credentialCommands.pop()}\\n\")\n\t\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(lastLn ==~ /(?i).*PRESS (ENTER|ANY KEY) TO CONTINUE.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : Press key Line\")\n\t\t\t\t\t\ttxStream.print(\"\\n\")\n\t\t\t\t\t} else if(lastLn ==~ /(?i)<?\\s*-+\\s*MORE\\s*(-+|or \\(?q\\)?uit)\\s*>?.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : More Line\")\n\t\t\t\t\t\ttxStream.print(\" \")\n\t\t\t\t\t} else if((prompt && lastLn == prompt) || (enablePrompt && lastLn == enablePrompt)) {\n\t\t\t\t\t\tdef newPromptIndex = stdout.lastIndexOf(prompt)\n\n\t\t\t\t\t\tif(enablePrompt) { // Check if there is a more recent EnablePrompt\n\t\t\t\t\t\t\tnewPromptIndex = Math.max(newPromptIndex, stdout.lastIndexOf(enablePrompt))\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(newPromptIndex != promptIndex || filteredPrompt) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Prompt Line\")\n\t\t\t\t\t\t\tpromptIndex = newPromptIndex\n\t\t\t\t\t\t\tisPrompt = true\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.push(\"WARN : Duplicate Prompt Index\")\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdef customFound = false\n\n\t\t\t\t\t\tcustomLineResponse.each { match, response->\n\t\t\t\t\t\t\tif(lastLn ==~ match) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Custom Response Line Found - ${lastLn}\")\n\t\t\t\t\t\t\t\ttxStream.print(response)\n\t\t\t\t\t\t\t\tcustomFound = true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!customFound) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Unknown Line - ${lastLn}\")\n\n\t\t\t\t\t\t\tif(!prompt && !lastLn.isAllWhitespace()) {\n\t\t\t\t\t\t\t\tif(lastLn.length() < promptMaxSize) {\n\t\t\t\t\t\t\t\t\tlog.push(\"INFO : Assuming line is prompt - ${lastLn}\")\n\t\t\t\t\t\t\t\t\tprompt = lastLn\n\t\t\t\t\t\t\t\t\tpromptIndex = stdout.lastIndexOf(prompt)\n\t\t\t\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tlog.push(\"INFO : Line greater than ${promptMaxSize} characters. Unlikely to be a prompt.\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isPrompt) { // A prompt is waiting for input. We do our actions here.\n\t\t\t\t\t\tif(!prompt) { // If we found a prompt with our prompt line cleared, update it\n\t\t\t\t\t\t\tprompt = enablePrompt\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(promptFilter && !promptValidated) {\n\t\t\t\t\t\t\tif(prompt ==~ /.*\\d+:\\d+:\\d+:.*/) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Prompt contains time\")\n\t\t\t\t\t\t\t\tprompt = prompt.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Time removed from prompt [${prompt}]\")\n\t\t\t\t\t\t\t\tfilteredPrompt = true\n\t\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpromptChecked = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(extraLoginCommands) {\n\t\t\t\t\t\t\tdef command = extraLoginCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Performing Second Login\")\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\t\tcredentialCommands = [loginPass]\n\t\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t\t} else if(escalationCommands) {\n\t\t\t\t\t\t\tdef command = escalationCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Escalation command\")\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\n\t\t\t\t\t\t\tif(command == \"enable\") {\n\t\t\t\t\t\t\t\tenablePrompt = \"${prompt[0..-2]}#\"\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Setting enable prompt to - ${enablePrompt}\")\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsleep(1000) // Prompt change unknown. Wait for change.\n\t\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcredentialCommands = [enblePass]\n\t\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t\t} else if(formattingCommands) {\n\t\t\t\t\t\t\tdef command = formattingCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Formatting command - ${command}\")\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\t} else if (collectingCommands) {\n\t\t\t\t\t\t\tdef command = collectingCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Collecting command - ${command}\")\n\t\t\t\t\t\t\tlastCollectionIndex = cursor\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.push(\"INFO : Command output finished\")\n\n\t\t\t\t\t\t\tdef out = stdout.substring(lastCollectionIndex)\n\n\t\t\t\t\t\t\tif(ansiMode) {\n\t\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .replaceAll(/\\n.*\\e\\[2(J|K)/, \"\\n\")\n\t\t\t\t\t\t\t\t\t\t .split(/\\n|\\r\\n|\\e\\[(1|2)?(J|K)/)\n\t\t\t\t\t\t\t\t\t\t .tail() // Remove first (prompt) line\n\t\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t .replaceAll(ansiEscapeRegex, \"\")\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .split(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t .tail()\n\t\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\t\t\t\t\tout = \"\"\n\t\t\t\t\t \t\t}\n\n\t\t\t\t\t\t\tif(out) {\n\t\t\t\t\t\t\t\tstate = States.SUCCESSFUL\n\t\t\t\t\t\t\t\tstats[\"size\"] = out.length()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlog.push(\"ERROR : Captured output was invalid\")\n\t\t\t\t\t\t\t\tlog.push(\"--- Command Result ---\")\n\t\t\t\t\t\t\t\tlog.push(stdout.substring(lastCollectionIndex))\n\t\t\t\t\t\t\t\tlog.push(\"----------------------\")\n\t\t\t\t\t\t\t\tstate = States.INVALID\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(System.currentTimeMillis() > startTime + maximumTimeout && state != States.SUCCESSFUL) { // Timeout\n\t\t\t\tif(lastCollectionIndex > 0) {\n\t\t\t\t\tdef out = stdout.substring(lastCollectionIndex)\n\t\t\t\t\t\t\t\t\t.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t.replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t.split(\"\\n\") // We probably need to handle cursor resets codes too\n\t\t\t\t\t\t\t\t\t.tail() // Remove first (prompt) line\n\t\t\t\t\t\t\t\t\t.join(\"\\n\")\n\t\t\t\t\t\t\t\t\t.trim()\n\t\t\t\t\t\t\t\t\t.replaceAll(\"(\\\\Q${prompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\t\t\tout = \"\"\n\t\t\t\t\t}\n\n\t\t\t\t\tif(out) {\n\t\t\t\t\t\tlog.push(\"Info : Partial output recieved\")\n\t\t\t\t\t\tstate = States.PARTIAL\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate = States.FAILED\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlog.push(\"ERROR : Timeout looking for valid line\")\n\t\t\t\t\tlog.push(\"--- Standard Output ---\")\n\t\t\t\t\tlog.push(stdout)\n\t\t\t\t\tlog.push(\"-----------------------\")\n\n\t\t\t\t\tstate = States.FAILED\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(state != States.RUNNING) { // Collection finished. Quit out safely.\n\t\t\t\tlog.push(\"INFO : Collection finished with ${state} state\")\n\t\t\t\ttxStream.print(\"\\u0003\") // Send a SIGINT to interupt anything running.\n\n\t\t\t\tendc.each {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlog.push(\"INFO : Sending End command - ${it}\")\n\t\t\t\t\t\ttxStream.print(\"${it}\\n\")\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tlog.push(\"WARN : Failed to send - ${it}\")\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tThread.sleep(1)\n\t\t}\n\t} catch (e) {\n\t\t\tlog.push(\"ERROR : Exception - ${e.message}\")\n\t} finally {\n\t\ttry {\n\t\t\tshell?.close()\n\t\t\tsession?.close()\n\t\t\tclient?.disconnect()\n\t\t} catch (e) {\n\t\t\tlog.push(\"ERROR : Exception Closing - ${e.message}\")\n\t\t}\n\n\t\tif(state == States.SUCCESSFUL || state == States.PARTIAL) {\n\t\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\n\t\t\tstats[\"time\"] = System.currentTimeMillis()\n\t\t\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\t\t\tstats[\"state\"] = state\n\t\t\tstats[\"log\"] = log\n\n\t\t\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\t\t\tfileCache.write(json)\n\n\t\t\tgotOutput = true\n\t\t}\n\t}\n}\n\nif(gotOutput) {\n\treturn 0\n} else {\n\tprintln log.join(\"\\n\")\n\treturn 1\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "// SSH Interactive Collection\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.util.Settings\nimport net.schmizz.sshj.SSHClient\nimport net.schmizz.sshj.common.SecurityUtils\nimport net.schmizz.sshj.connection.channel.Channel\nimport net.schmizz.sshj.connection.channel.direct.PTYMode\nimport net.schmizz.sshj.connection.channel.direct.Session\nimport net.schmizz.sshj.connection.channel.direct.Session.Shell\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport java.security.MessageDigest\nimport groovy.json.JsonOutput\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef fmtc = hostProps.get(\"config.commands.formatting\", hostProps.get(\"auto.config.commands.formatting\", \"\")).tokenize(\",\")\ndef endc = hostProps.get(\"auto.config.commands.end\", \"exit\").tokenize(\",\")\n\ndef customPrompt = hostProps.get(\"config.prompt\", hostProps.get(\"auto.config.prompt\", \"\"))\ndef pty = hostProps.get(\"config.pty\", hostProps.get(\"auto.config.pty\", \"vt100\"))\n\ndef escalationCommand = hostProps.get(\"auto.config.escalation.command\", \"enable\")\n\ndef enblePass = hostProps.get(\"ssh.enable.pass\", hostProps.get(\"config.enable.pass\", \"\"))\ndef loginPass = hostProps.get(\"ssh.login.pass\", hostProps.get(\"config.login.pass\", \"\"))\n\ndef promptFilter = hostProps.get(\"ssh.prompt.filter\", \"true\") ==~ \"1|true\"\n\n// Accepts strings in the format LINE_REGEX=>RESPONSE seperated by commas to be acted upon.\ndef customLineResponse = hostProps.get(\"config.custom.response\", \"\")\n\t\t\t\t\t\t\t\t .split(\",\")\n\t\t\t\t\t\t\t\t .collectEntries { it.tokenize(\"=>\").with { [(it[0]):it[1]] }}\n\t\t\t\t\t\t\t\t .findAll{ it.value != null }\n\ndef promptMaxSize = hostProps.get(\"config.prompt.maxsize\", \"64\").toInteger() // A sanity check when looking for a prompt.\n\ndef connectTimeout = 30000 // Timeout attempting a connection.\ndef readingTimeout = 60000 // Timeout waiting on data.\ndef maximumTimeout = (Settings.getSettingInt(\"configcollector.script.timeout\", 300) - 5) * 1000 // The maximum time to attempt collection.\n\ndef wild = instanceProps.get(\"wildvalue\")\ndef version = instanceProps.get(\"auto.config.instance.version\", \"-1\")\n\nif(version != \"-1\" && version != hostProps.get(\"auto.config.version\", \"-1\")) {\n\tprintln \"Collecting the incorrect version. AD needs to run successfully at least once to update props.\"\n\treturn 1\n}\n\nenum States {\n\tRUNNING, FAILED, SUCCESSFUL, INVALID, PARTIAL\n}\n\ndef ansiEscapeRegex = /[\\u001B\\u009B][\\[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))/\ndef newLineCharacters = [\"\\n\", \"\\r\", \"\\u001B[J\", \"\\u001B[1J\", \"\\u001B[2J\", \"\\u001B[K\", \"\\u001B[1K\", \"\\u001B[2K\"]\n\ndef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\ndef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\nnew File(fileCache.getParent()).mkdirs()\n\ndef stats = [:]\nstats[\"type\"] = \"INTERACTIVE\"\nstats[\"host\"] = host\nstats[\"wildvalue\"] = wild\n\ndef client = new SSHClient()\nclient.setTimeout(maximumTimeout)\nclient.setConnectTimeout(connectTimeout)\nclient.addHostKeyVerifier(new PromiscuousVerifier())\n\ntry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\ndef state = States.RUNNING\ndef session = null\ndef shell = null\n\ndef log = []\ndef stdout = \"\"\n\ndef startTime = System.currentTimeMillis()\n\ntry {\n\tlog.push(\"INFO : Connecting to [${host}]\")\n\tclient.connect(host, port.toInteger())\n\n\tif(pKey && new File(pKey).exists()) {\n\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t} else {\n\t\tclient.auth(user,\n\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\tnew AuthNone())\n\t}\n\n\tsession = client.startSession()\n\tlog.push(\"INFO : Allocating [${pty}] Pseudoterminal\")\n\tsession.allocatePTY(pty, 80, 24, 0, 0, Collections.<PTYMode, Integer> emptyMap());\n\t\n\tshell = session.startShell()\n\n\tdef txStream = new PrintStream(shell.getOutputStream(), true)\n\tdef rxStream = shell.getInputStream()\n\n\tdef ansiMode = false\n\tdef cursor = 0\n\tdef inputData = new byte[Math.max(5242880, Settings.getSettingInt(Settings.CONFIGURATION_MAX_LENGTH, 5242880))]\n\n\tdef prompt = customPrompt ?: \"\"\n\tdef enablePrompt = \"\"\n\tdef promptIndex = -1\n\tdef promptValidated = false\n\tdef filteredPrompt = false\n\n\tdef formattingCommands = fmtc\n\tdef collectingCommands = [wild]\n\tdef escalationCommands = enblePass ? [escalationCommand] : []\n\tdef extraLoginCommands = loginPass ? [\"login\"] : []\n\tdef credentialCommands = [pass] // Used to store auth crednetials so we don't attempt them multiple times\n\n\tdef lastCollectionCommand = \"\"\n\tdef lastCollectionIndex = -1\n\tdef lastSize = -1\n\n\tdef readTimeoutEnd = System.currentTimeMillis() + readingTimeout\n\n\twhile(state == States.RUNNING) {\n\t\tdef availableBytes = rxStream.available()\n\n\t\tif(availableBytes > 0) {\n\t\t\tif(cursor + availableBytes >= inputData.length) {\n\t\t\t\tlog.push(\"ERROR : Size of output greater than configured maximum\")\n\t\t\t\tstats[\"rawSize\"] = cursor + availableBytes\n\t\t\t\tstate = States.FAILED\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tcursor += rxStream.read(inputData, cursor, Math.min(availableBytes, inputData.length - cursor))\n\n\t\t\treadTimeoutEnd = System.currentTimeMillis() + readingTimeout\n\n\t\t\tstdout = new String(inputData[0..<cursor] as byte[])\n\n\t\t\tdef endLineIndex = 0\n\t\t\tdef endLineSize = 0\n\n\t\t\tnewLineCharacters.each { lineEnd->\n\t\t\t\tdef lineEndIndexCheck = stdout.lastIndexOf(lineEnd)\n\n\t\t\t\tif(lineEndIndexCheck > endLineIndex &&\n\t\t\t\t lineEndIndexCheck + lineEnd.length() < stdout.size()) {\n\t\t\t\t\tendLineIndex = lineEndIndexCheck\n\t\t\t\t\tendLineSize = lineEnd.length()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(stdout.size() != lastSize) {\n\t\t\t\tlastSize = stdout.size()\n\t\t\t\tdef lastLn = stdout.substring(endLineIndex + endLineSize)\n\n\t\t\t\tif(ansiMode || lastLn.contains(\"\\u001B\")) {\n\t\t\t\t\tif(!ansiMode) {\n\t\t\t\t\t\tansiMode = true\n\t\t\t\t\t\tlog.push(\"INFO : Entering ANSI mode\")\n\t\t\t\t\t}\n\t\t\t\t\tlastLn = lastLn.replaceAll(ansiEscapeRegex,\"\")\n\t\t\t\t}\n\n\t\t\t\tlastLn = lastLn.trim()\n\t\t\t\t\n\t\t\t\tif(filteredPrompt && lastLn ==~ /.*\\d+:\\d+:\\d+:.*/) { // If times may be involved, strip all times from line\n\t\t\t\t\tlog.push(\"INFO : Line [${lastLn}] needs edit for filtered prompt\")\n\t\t\t\t\tlastLn = lastLn.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\tlog.push(\"INFO : Line changed to ${lastLn}\")\n\t\t\t\t}\n\n\t\t\t\tdef isPrompt = false\n\n\t\t\t\tif(lastLn ==~ /(?i)^(PLEASE ENTER LOGIN NAME|USER\\s?(NAME)?)\\s*:.*/) {\n\t\t\t\t\tlog.push(\"INFO : User Line\")\n\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\tlog.push(\"INFO : Sending Username\")\n\t\t\t\t\t\ttxStream.print(\"${user}\\n\")\n\t\t\t\t\t}\n\t\t\t\t} else if(lastLn ==~ /(?i)^(PLEASE ENTER )?PASS(WORD)?\\s*:.*/) {\n\t\t\t\t\tlog.push(\"INFO : Pass Line\")\n\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\tif(credentialCommands) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Password\")\n\t\t\t\t\t\t\ttxStream.print(\"${credentialCommands.pop()}\\n\")\n\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if(lastLn ==~ /(?i).*PRESS (ENTER|ANY KEY) TO CONTINUE.*/) {\n\t\t\t\t\tlog.push(\"INFO : Press key Line\")\n\t\t\t\t\ttxStream.print(\"\\n\")\n\t\t\t\t} else if(lastLn ==~ /(?i)<?\\s*-+\\s*MORE\\s*(-+|or \\(?q\\)?uit)\\s*>?.*/) {\n\t\t\t\t\tlog.push(\"INFO : More Line\")\n\t\t\t\t\ttxStream.print(\" \")\n\t\t\t\t} else if((prompt && lastLn == prompt) || (enablePrompt && lastLn == enablePrompt)) {\n\t\t\t\t\tdef newPromptIndex = stdout.lastIndexOf(prompt)\n\n\t\t\t\t\tif(enablePrompt) { // Check if there is a more recent EnablePrompt\n\t\t\t\t\t\tnewPromptIndex = Math.max(newPromptIndex, stdout.lastIndexOf(enablePrompt))\n\t\t\t\t\t}\n\n\t\t\t\t\tif(newPromptIndex != promptIndex || filteredPrompt) {\n\t\t\t\t\t\tlog.push(\"INFO : Prompt Line\")\n\t\t\t\t\t\tpromptIndex = newPromptIndex\n\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.push(\"WARN : Duplicate Prompt Index\")\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdef customFound = false\n\n\t\t\t\t\tcustomLineResponse.each { match, response->\n\t\t\t\t\t\tif(lastLn ==~ match) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Custom Response Line Found - ${lastLn}\")\n\t\t\t\t\t\t\ttxStream.print(response)\n\t\t\t\t\t\t\tcustomFound = true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!customFound) {\n\t\t\t\t\t\tlog.push(\"INFO : Unknown Line - ${lastLn}\")\n\n\t\t\t\t\t\tif(!prompt && !lastLn.isAllWhitespace()) {\n\t\t\t\t\t\t\tif(lastLn.length() < promptMaxSize) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Assuming line is prompt - ${lastLn}\")\n\t\t\t\t\t\t\t\tprompt = lastLn\n\t\t\t\t\t\t\t\tpromptIndex = stdout.lastIndexOf(prompt)\n\t\t\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Line greater than ${promptMaxSize} characters. Unlikely to be a prompt.\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(isPrompt) { // A prompt is waiting for input. We do our actions here.\n\t\t\t\t\tif(!prompt) { // If we found a prompt with our prompt line cleared, update it\n\t\t\t\t\t\tprompt = enablePrompt\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tif(promptFilter && !promptValidated) {\n\t\t\t\t\t\tif(prompt ==~ /.*\\d+:\\d+:\\d+:.*/) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Prompt contains time\")\n\t\t\t\t\t\t\tprompt = prompt.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\t\t\tlog.push(\"INFO : Time removed from prompt [${prompt}]\")\n\t\t\t\t\t\t\tfilteredPrompt = true\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tpromptChecked = true\n\t\t\t\t\t}\n\n\t\t\t\t\tif(extraLoginCommands) {\n\t\t\t\t\t\tdef command = extraLoginCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Performing Second Login\")\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\tcredentialCommands = [loginPass]\n\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t} else if(escalationCommands) {\n\t\t\t\t\t\tdef command = escalationCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Sending Escalation command\")\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\n\t\t\t\t\t\tif(command == \"enable\") {\n\t\t\t\t\t\t\tenablePrompt = \"${prompt[0..-2]}#\"\n\t\t\t\t\t\t\tlog.push(\"INFO : Setting enable prompt to - ${enablePrompt}\")\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsleep(1000) // Prompt change unknown. Wait for change.\n\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcredentialCommands = [enblePass]\n\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t} else if(formattingCommands) {\n\t\t\t\t\t\tdef command = formattingCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Sending Formatting command - ${command}\")\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t}else if (collectingCommands) {\n\t\t\t\t\t\tdef command = collectingCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Sending Collecting command - ${command}\")\n\t\t\t\t\t\tlastCollectionIndex = cursor\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.push(\"INFO : Command output finished\")\n\n\t\t\t\t\t\tdef out = stdout.substring(lastCollectionIndex)\n\n\t\t\t\t\t\tif(ansiMode) {\n\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t .replaceAll(/\\n.*\\e\\[2(J|K)/, \"\\n\")\n\t\t\t\t\t\t\t\t\t .split(/\\n|\\r\\n|\\e\\[(1|2)?(J|K)/)\n\t\t\t\t\t\t\t\t\t .tail() // Remove first (prompt) line\n\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t .replaceAll(ansiEscapeRegex, \"\")\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t .split(\"\\n\")\n\t\t\t\t\t\t\t\t\t .tail()\n\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\t\t\t\tout = \"\"\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(out) {\n\t\t\t\t\t\t\tprint out\n\n\t\t\t\t\t\t\tstate = States.SUCCESSFUL\n\t\t\t\t\t\t\tstats[\"size\"] = out.length()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.push(\"ERROR : Captured output was invalid\")\n\t\t\t\t\t\t\tlog.push(\"--- Command Result ---\")\n\t\t\t\t\t\t\tlog.push(stdout.substring(lastCollectionIndex))\n\t\t\t\t\t\t\tlog.push(\"----------------------\")\n\t\t\t\t\t\t\tstate = States.INVALID\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(System.currentTimeMillis() > readTimeoutEnd && state != States.SUCCESSFUL) { // Timeout\n\t\t\tlog.push(\"ERROR : Timeout looking for valid line\")\n\t\t\tlog.push(\"--- Standard Output ---\")\n\t\t\tlog.push(stdout)\n\t\t\tlog.push(\"-----------------------\")\n\n\t\t\tstate = States.FAILED\n\t\t}\n\n\n\t\tif(System.currentTimeMillis() > startTime + maximumTimeout) { // Timeout\n\t\t\tlog.push(\"ERROR : Maximum timeout reached\")\n\t\t\t\n\t\t\tstate = States.FAILED\n\t\t}\n\n\t\tif(state != States.RUNNING) { // Collection finished. Quit out safely.\n\t\t\tlog.push(\"INFO : Collection finished with ${state} state\")\n\t\t\ttxStream.print(\"\\u0003\") // Send a SIGINT to interupt anything running.\n\n\t\t\tendc.each {\n\t\t\t\ttry {\n\t\t\t\t\tlog.push(\"INFO : Sending End command - ${it}\")\n\t\t\t\t\ttxStream.print(\"${it}\\n\")\n\t\t\t\t} catch (ex) {\n\t\t\t\t\tlog.push(\"WARN : Failed to send - ${it}\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\n\t\tThread.sleep(1)\n\t}\n} catch (e) {\n\tlog.push(\"ERROR : Exception - ${e.message}\")\n} finally {\n\ttry {\n\t\tshell?.close()\n\t\tsession?.close()\n\t\tclient?.disconnect()\n\t} catch (e) {\n\t\tlog.push(\"ERROR : Exception Closing - ${e.message}\")\n\t}\n\n\tstats[\"time\"] = System.currentTimeMillis()\n\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\tstats[\"state\"] = state\n\tstats[\"log\"] = log\n\tstats[\"rawSize\"] = stats[\"rawSize\"] ?: stdout.length()\n\n\tif(state != States.SUCCESSFUL) {\n\t\tprintln \"--- Collection Failure Log ---\"\n\t\tprint log.join(\"\\n\")\n\t}\n\n\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\tfileCache.write(json)\n\n\treturn (state == States.SUCCESSFUL) ? 0 : 1\n}"}, "configChecks": [{"name": "NoAlert", "description": "", "type": "groovy", "attrs": {"script": "// Dynamic configs are expected to change frequently.\n// A groovy script check allows the config to update without firing an alert.\nreturn 0"}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: SSH_Interactive_Standard (2318)

{"name": "SSH_Interactive_Standard", "description": "Common module for handling generic SSH Interactive config collection.\nDynamic configs are set to not alert on change by default.", "appliesTo": "auto.config.type.interactive", "group": "Common ConfigSources", "searchKeywords": "configuration,ssh,networking,switch", "technicalNotes": "-Host Properties-\nssh.user\t\t\t: Username\nssh.pass\t\t\t: Password\nssh.publickey\t\t: Location of key (optional)\nssh.port\t\t\t: Port (optional)\nssh.enable.pass\t: Privilege escalation password (optional)\nconfig.filter \t\t: Regex used to filter output. Can be used for removing MOTD messages or personal information. (optional)", "displayedAs": "Standard Configs (SSH Interactive)", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 2, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "// SSH Interactive Standard AD\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/ \nimport com.santaba.agent.util.Settings\nimport net.schmizz.sshj.SSHClient\nimport net.schmizz.sshj.common.SecurityUtils\nimport net.schmizz.sshj.connection.channel.Channel\nimport net.schmizz.sshj.connection.channel.direct.PTYMode\nimport net.schmizz.sshj.connection.channel.direct.Session\nimport net.schmizz.sshj.connection.channel.direct.Session.Shell\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport java.security.MessageDigest\nimport groovy.json.JsonSlurper\nimport groovy.json.JsonOutput\n\ndef version = hostProps.get(\"auto.config.version\", \"-1\")\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef pipe = hostProps.get(\"auto.config.commands.pipe\", \"\")\ndef fmtc = hostProps.get(\"config.commands.formatting\", hostProps.get(\"auto.config.commands.formatting\", \"\")).tokenize(\",\")\ndef endc = hostProps.get(\"auto.config.commands.end\", \"exit\").tokenize(\",\")\ndef cmds = hostProps.get(\"config.commands.standard\", hostProps.get(\"auto.config.commands.standard\", \"\")).split(\",\").flatten()\n\ndef customPrompt = hostProps.get(\"config.prompt\", hostProps.get(\"auto.config.prompt\", \"\"))\ndef pty = hostProps.get(\"config.pty\", hostProps.get(\"auto.config.pty\", \"vt100\"))\n\ndef escalationCommand = hostProps.get(\"auto.config.escalation.command\", \"enable\")\n\ndef enblePass = hostProps.get(\"ssh.enable.pass\", hostProps.get(\"config.enable.pass\", \"\"))\ndef loginPass = hostProps.get(\"ssh.login.pass\", hostProps.get(\"config.login.pass\", \"\"))\n\ndef promptFilter = hostProps.get(\"ssh.prompt.filter\", \"true\") ==~ \"1|true\"\n\n// Accepts strings in the format LINE_REGEX=>RESPONSE seperated by commas to be acted upon.\ndef customLineResponse = hostProps.get(\"config.custom.response\", \"\")\n\t\t\t\t\t\t\t\t .split(\",\")\n\t\t\t\t\t\t\t\t .collectEntries { it.tokenize(\"=>\").with { [(it[0]):it[1]] }}\n\t\t\t\t\t\t\t\t .findAll{ it.value != null }\n\ndef promptMaxSize = hostProps.get(\"config.prompt.maxsize\", \"64\").toInteger() // A sanity check when looking for a prompt.\n\ndef connectTimeout = 30000 // Timeout attempting a connection.\ndef readingTimeout = 60000 // Timeout waiting on data.\ndef maximumTimeout = (Settings.getSettingInt(\"discover.script.timeoutInSec\", 300) - 10) * 1000 // The maximum time to attempt collection.\n\nenum States {\n\tRUNNING, FAILED, SUCCESSFUL, INVALID, PARTIAL\n}\n\ndef ansiEscapeRegex = /[\\u001B\\u009B][\\[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))/\ndef newLineCharacters = [\"\\n\", \"\\r\", \"\\u001b[J\", \"\\u001b[1J\", \"\\u001b[2J\", \"\\u001b[K\", \"\\u001b[1K\", \"\\u001b[2K\"]\n\ndef log = []\ndef gotOutput = false\n\n// By shuffling the potential instances, we eventually allow for each to get the full timeout period.\nCollections.shuffle(cmds)\n\ncmds.grep().each { it->\n\tdef (wild, alias) = it.split('=', 2)\n\t\n\twild += pipe\n\n\tdef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\n\tdef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\n\tnew File(fileCache.getParent()).mkdirs()\n\t\n\tif(fileCache.exists()) {\n\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\t\tgotOutput = true\n\t\treturn\n\t}\n\n\tdef stats = [:]\n\tstats[\"type\"] = \"INTERACTIVE\"\n\tstats[\"host\"] = host\n\tstats[\"wildvalue\"] = wild\n\n\tdef client = new SSHClient()\n\tclient.setTimeout(maximumTimeout)\n\tclient.setConnectTimeout(connectTimeout)\n\tclient.addHostKeyVerifier(new PromiscuousVerifier())\n\n\ttry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\n\tdef state = States.RUNNING\n\tdef session = null\n\tdef shell = null\n\n\ttry {\n\t\tlog.push(\"INFO : Connecting to [${host}]\")\n\t\tclient.connect(host, port.toInteger())\n\n\t\tif(pKey && new File(pKey).exists()) {\n\t\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t\t} else {\n\t\t\tclient.auth(user,\n\t\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\t\tnew AuthNone())\n\t\t}\n\n\t\tsession = client.startSession()\n\t\tlog.push(\"INFO : Allocating [${pty}] Pseudoterminal\")\n \tsession.allocatePTY(pty, 80, 24, 0, 0, Collections.<PTYMode, Integer> emptyMap());\n\n\t\tdef startTime = System.currentTimeMillis()\n\n\t\tshell = session.startShell()\n\n\t\tdef txStream = new PrintStream(shell.getOutputStream(), true)\n\t\tdef rxStream = shell.getInputStream()\n\n\t\tdef ansiMode = false\n\t\tdef cursor = 0\n\t\tdef inputData = new byte[Math.max(5242880, Settings.getSettingInt(Settings.CONFIGURATION_MAX_LENGTH, 5242880))]\n\n\t\tdef prompt = customPrompt ?: \"\"\n\t\tdef enablePrompt = \"\"\n\t\tdef promptIndex = -1\n\t\tdef promptValidated = false\n\t\tdef filteredPrompt = false\n\t\t\n\t\tdef stdout = \"\"\n\n\t\tdef formattingCommands = fmtc\n\t\tdef collectingCommands = [wild]\n\t\tdef escalationCommands = enblePass ? [escalationCommand] : []\n\t\tdef extraLoginCommands = loginPass ? [\"login\"] : []\n\t\tdef credentialCommands = [pass] // Used to store auth crednetials so we don't attempt them multiple times\n\n\t\tdef lastCollectionCommand = \"\"\n\t\tdef lastCollectionIndex = -1\n\t\tdef lastSize = -1\n\n\t\twhile(state == States.RUNNING) {\n\t\t\tdef availableBytes = rxStream.available()\n\n\t\t\tif(availableBytes > 0) {\n\t\t\t\tif(cursor + availableBytes >= inputData.length) {\n\t\t\t\t\tlog.push(\"ERROR : Size of output greater than configured maximum\")\n\t\t\t\t\tstats[\"rawSize\"] = cursor + availableBytes\n\t\t\t\t\tstate = States.PARTIAL // We may want to set this to failed in some circumstance\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tcursor += rxStream.read(inputData, cursor, Math.min(availableBytes, inputData.length - cursor))\n\n\t\t\t\tstdout = new String(inputData[0..<cursor] as byte[])\n\n\t\t\t\tdef endLineIndex = 0\n\t\t\t\tdef endLineSize = 0\n\n\t\t\t\tnewLineCharacters.each { lineEnd->\n\t\t\t\t\tdef lineEndIndexCheck = stdout.lastIndexOf(lineEnd)\n\n\t\t\t\t\tif(lineEndIndexCheck > endLineIndex &&\n\t\t\t\t\t lineEndIndexCheck + lineEnd.length() < stdout.size()) {\n\t\t\t\t\t\tendLineIndex = lineEndIndexCheck\n\t\t\t\t\t\tendLineSize = lineEnd.length()\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(stdout.size() != lastSize) {\n\t\t\t\t\tlastSize = stdout.size()\n\t\t\t\t\tdef lastLn = stdout.substring(endLineIndex + endLineSize)\n\n\t\t\t\t\tif(ansiMode || lastLn.contains(\"\\u001b\")) {\n\t\t\t\t\t\tif(!ansiMode) {\n\t\t\t\t\t\t\tansiMode = true\n\t\t\t\t\t\t\tlog.push(\"INFO : Entering ANSI mode\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastLn = lastLn.replaceAll(ansiEscapeRegex,\"\")\n\t\t\t\t\t}\n\n\t\t\t\t\tlastLn = lastLn.trim()\n\n\t\t\t\t\tif(filteredPrompt && lastLn ==~ /.*\\d+:\\d+:\\d+:.*/) { // If times may be involved, strip all times from line\n\t\t\t\t\t\tlog.push(\"INFO : Line [${lastLn}] needs edit for filtered prompt\")\n\t\t\t\t\t\tlastLn = lastLn.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\t\tlog.push(\"INFO : Line changed to ${lastLn}\")\n\t\t\t\t\t}\n\n\t\t\t\t\tdef isPrompt = false\n\t\n\t\t\t\t\tif(lastLn ==~ /(?i)^(PLEASE ENTER LOGIN NAME|USER\\s?(NAME)?)\\s*:.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : User Line\")\n\t\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Username\")\n\t\t\t\t\t\t\ttxStream.print(\"${user}\\n\")\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(lastLn ==~ /(?i)^(PLEASE ENTER )?PASS(WORD)?\\s*:.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : Pass Line\")\n\t\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\t\tif(credentialCommands) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Sending Password\")\n\t\t\t\t\t\t\t\ttxStream.print(\"${credentialCommands.pop()}\\n\")\n\t\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(lastLn ==~ /(?i).*PRESS (ENTER|ANY KEY) TO CONTINUE.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : Press key Line\")\n\t\t\t\t\t\ttxStream.print(\"\\n\")\n\t\t\t\t\t} else if(lastLn ==~ /(?i)<?\\s*-+\\s*MORE\\s*(-+|or \\(?q\\)?uit)\\s*>?.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : More Line\")\n\t\t\t\t\t\ttxStream.print(\" \")\n\t\t\t\t\t} else if((prompt && lastLn == prompt) || (enablePrompt && lastLn == enablePrompt)) {\n\t\t\t\t\t\tdef newPromptIndex = stdout.lastIndexOf(prompt)\n\n\t\t\t\t\t\tif(enablePrompt) { // Check if there is a more recent EnablePrompt\n\t\t\t\t\t\t\tnewPromptIndex = Math.max(newPromptIndex, stdout.lastIndexOf(enablePrompt))\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(newPromptIndex != promptIndex || filteredPrompt) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Prompt Line\")\n\t\t\t\t\t\t\tpromptIndex = newPromptIndex\n\t\t\t\t\t\t\tisPrompt = true\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.push(\"WARN : Duplicate Prompt Index\")\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdef customFound = false\n\n\t\t\t\t\t\tcustomLineResponse.each { match, response->\n\t\t\t\t\t\t\tif(lastLn ==~ match) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Custom Response Line Found - ${lastLn}\")\n\t\t\t\t\t\t\t\ttxStream.print(response)\n\t\t\t\t\t\t\t\tcustomFound = true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!customFound) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Unknown Line - ${lastLn}\")\n\n\t\t\t\t\t\t\tif(!prompt && !lastLn.isAllWhitespace()) {\n\t\t\t\t\t\t\t\tif(lastLn.length() < promptMaxSize) {\n\t\t\t\t\t\t\t\t\tlog.push(\"INFO : Assuming line is prompt - ${lastLn}\")\n\t\t\t\t\t\t\t\t\tprompt = lastLn\n\t\t\t\t\t\t\t\t\tpromptIndex = stdout.lastIndexOf(prompt)\n\t\t\t\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tlog.push(\"INFO : Line greater than ${promptMaxSize} characters. Unlikely to be a prompt.\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isPrompt) { // A prompt is waiting for input. We do our actions here.\n\t\t\t\t\t\tif(!prompt) { // If we found a prompt with our prompt line cleared, update it\n\t\t\t\t\t\t\tprompt = enablePrompt\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(promptFilter && !promptValidated) {\n\t\t\t\t\t\t\tif(prompt ==~ /.*\\d+:\\d+:\\d+:.*/) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Prompt contains time\")\n\t\t\t\t\t\t\t\tprompt = prompt.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Time removed from prompt [${prompt}]\")\n\t\t\t\t\t\t\t\tfilteredPrompt = true\n\t\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpromptChecked = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(extraLoginCommands) {\n\t\t\t\t\t\t\tdef command = extraLoginCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Performing Second Login\")\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\t\tcredentialCommands = [loginPass]\n\t\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t\t} else if(escalationCommands) {\n\t\t\t\t\t\t\tdef command = escalationCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Escalation command\")\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\n\t\t\t\t\t\t\tif(command == \"enable\") {\n\t\t\t\t\t\t\t\tenablePrompt = \"${prompt[0..-2]}#\"\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Setting enable prompt to - ${enablePrompt}\")\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsleep(1000) // Prompt change unknown. Wait for change.\n\t\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcredentialCommands = [enblePass]\n\t\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t\t} else if(formattingCommands) {\n\t\t\t\t\t\t\tdef command = formattingCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Formatting command - ${command}\")\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\t} else if (collectingCommands) {\n\t\t\t\t\t\t\tdef command = collectingCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Collecting command - ${command}\")\n\t\t\t\t\t\t\tlastCollectionIndex = cursor\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.push(\"INFO : Command output finished\")\n\n\t\t\t\t\t\t\tdef out = stdout.substring(lastCollectionIndex)\n\n\t\t\t\t\t\t\tif(ansiMode) {\n\t\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .replaceAll(/\\n.*\\e\\[2(J|K)/, \"\\n\")\n\t\t\t\t\t\t\t\t\t\t .split(/\\n|\\r\\n|\\e\\[(1|2)?(J|K)/)\n\t\t\t\t\t\t\t\t\t\t .tail() // Remove first (prompt) line\n\t\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t .replaceAll(ansiEscapeRegex, \"\")\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .split(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t .tail()\n\t\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\t\t\t\t\tout = \"\"\n\t\t\t\t\t \t\t}\n\n\t\t\t\t\t\t\tif(out) {\n\t\t\t\t\t\t\t\tstate = States.SUCCESSFUL\n\t\t\t\t\t\t\t\tstats[\"size\"] = out.length()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlog.push(\"ERROR : Captured output was invalid\")\n\t\t\t\t\t\t\t\tlog.push(\"--- Command Result ---\")\n\t\t\t\t\t\t\t\tlog.push(stdout.substring(lastCollectionIndex))\n\t\t\t\t\t\t\t\tlog.push(\"----------------------\")\n\t\t\t\t\t\t\t\tstate = States.INVALID\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(System.currentTimeMillis() > startTime + maximumTimeout && state != States.SUCCESSFUL) { // Timeout\n\t\t\t\tif(lastCollectionIndex > 0) {\n\t\t\t\t\tdef out = stdout.substring(lastCollectionIndex)\n\t\t\t\t\t\t\t\t\t.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t.replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t.split(\"\\n\") // We probably need to handle cursor resets codes too\n\t\t\t\t\t\t\t\t\t.tail() // Remove first (prompt) line\n\t\t\t\t\t\t\t\t\t.join(\"\\n\")\n\t\t\t\t\t\t\t\t\t.trim()\n\t\t\t\t\t\t\t\t\t.replaceAll(\"(\\\\Q${prompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\t\t\tout = \"\"\n\t\t\t\t\t}\n\n\t\t\t\t\tif(out) {\n\t\t\t\t\t\tlog.push(\"Info : Partial output recieved\")\n\t\t\t\t\t\tstate = States.PARTIAL\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate = States.FAILED\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlog.push(\"ERROR : Timeout looking for valid line\")\n\t\t\t\t\tlog.push(\"--- Standard Output ---\")\n\t\t\t\t\tlog.push(stdout)\n\t\t\t\t\tlog.push(\"-----------------------\")\n\n\t\t\t\t\tstate = States.FAILED\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(state != States.RUNNING) { // Collection finished. Quit out safely.\n\t\t\t\tlog.push(\"INFO : Collection finished with ${state} state\")\n\t\t\t\ttxStream.print(\"\\u0003\") // Send a SIGINT to interupt anything running.\n\n\t\t\t\tendc.each {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlog.push(\"INFO : Sending End command - ${it}\")\n\t\t\t\t\t\ttxStream.print(\"${it}\\n\")\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tlog.push(\"WARN : Failed to send - ${it}\")\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tThread.sleep(1)\n\t\t}\n\t} catch (e) {\n\t\t\tlog.push(\"ERROR : Exception - ${e.message}\")\n\t} finally {\n\t\ttry {\n\t\t\tshell?.close()\n\t\t\tsession?.close()\n\t\t\tclient?.disconnect()\n\t\t} catch (e) {\n\t\t\tlog.push(\"ERROR : Exception Closing - ${e.message}\")\n\t\t}\n\n\t\tif(state == States.SUCCESSFUL || state == States.PARTIAL) {\n\t\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\n\t\t\tstats[\"time\"] = System.currentTimeMillis()\n\t\t\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\t\t\tstats[\"state\"] = state\n\t\t\tstats[\"log\"] = log\n\n\t\t\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\t\t\tfileCache.write(json)\n\n\t\t\tgotOutput = true\n\t\t}\n\t}\n}\n\nif(gotOutput) {\n\treturn 0\n} else {\n\tprintln log.join(\"\\n\")\n\treturn 1\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "// SSH Interactive Collection\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.util.Settings\nimport net.schmizz.sshj.SSHClient\nimport net.schmizz.sshj.common.SecurityUtils\nimport net.schmizz.sshj.connection.channel.Channel\nimport net.schmizz.sshj.connection.channel.direct.PTYMode\nimport net.schmizz.sshj.connection.channel.direct.Session\nimport net.schmizz.sshj.connection.channel.direct.Session.Shell\nimport net.schmizz.sshj.transport.verification.PromiscuousVerifier\nimport net.schmizz.sshj.userauth.password.PasswordUtils\nimport net.schmizz.sshj.userauth.method.*\nimport java.security.MessageDigest\nimport groovy.json.JsonOutput\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"ssh.user\", hostProps.get(\"config.user\"))\ndef pass = hostProps.get(\"ssh.pass\", hostProps.get(\"config.pass\"))\ndef pKey = hostProps.get(\"ssh.publickey\")\ndef port = hostProps.get(\"auto.config.port\", \"22\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef fmtc = hostProps.get(\"config.commands.formatting\", hostProps.get(\"auto.config.commands.formatting\", \"\")).tokenize(\",\")\ndef endc = hostProps.get(\"auto.config.commands.end\", \"exit\").tokenize(\",\")\n\ndef customPrompt = hostProps.get(\"config.prompt\", hostProps.get(\"auto.config.prompt\", \"\"))\ndef pty = hostProps.get(\"config.pty\", hostProps.get(\"auto.config.pty\", \"vt100\"))\n\ndef escalationCommand = hostProps.get(\"auto.config.escalation.command\", \"enable\")\n\ndef enblePass = hostProps.get(\"ssh.enable.pass\", hostProps.get(\"config.enable.pass\", \"\"))\ndef loginPass = hostProps.get(\"ssh.login.pass\", hostProps.get(\"config.login.pass\", \"\"))\n\ndef promptFilter = hostProps.get(\"ssh.prompt.filter\", \"true\") ==~ \"1|true\"\n\n// Accepts strings in the format LINE_REGEX=>RESPONSE seperated by commas to be acted upon.\ndef customLineResponse = hostProps.get(\"config.custom.response\", \"\")\n\t\t\t\t\t\t\t\t .split(\",\")\n\t\t\t\t\t\t\t\t .collectEntries { it.tokenize(\"=>\").with { [(it[0]):it[1]] }}\n\t\t\t\t\t\t\t\t .findAll{ it.value != null }\n\ndef promptMaxSize = hostProps.get(\"config.prompt.maxsize\", \"64\").toInteger() // A sanity check when looking for a prompt.\n\ndef connectTimeout = 30000 // Timeout attempting a connection.\ndef readingTimeout = 60000 // Timeout waiting on data.\ndef maximumTimeout = (Settings.getSettingInt(\"configcollector.script.timeout\", 300) - 5) * 1000 // The maximum time to attempt collection.\n\ndef wild = instanceProps.get(\"wildvalue\")\ndef version = instanceProps.get(\"auto.config.instance.version\", \"-1\")\n\nif(version != \"-1\" && version != hostProps.get(\"auto.config.version\", \"-1\")) {\n\tprintln \"Collecting the incorrect version. AD needs to run successfully at least once to update props.\"\n\treturn 1\n}\n\nenum States {\n\tRUNNING, FAILED, SUCCESSFUL, INVALID, PARTIAL\n}\n\ndef ansiEscapeRegex = /[\\u001B\\u009B][\\[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))/\ndef newLineCharacters = [\"\\n\", \"\\r\", \"\\u001B[J\", \"\\u001B[1J\", \"\\u001B[2J\", \"\\u001B[K\", \"\\u001B[1K\", \"\\u001B[2K\"]\n\ndef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\ndef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\nnew File(fileCache.getParent()).mkdirs()\n\ndef stats = [:]\nstats[\"type\"] = \"INTERACTIVE\"\nstats[\"host\"] = host\nstats[\"wildvalue\"] = wild\n\ndef client = new SSHClient()\nclient.setTimeout(maximumTimeout)\nclient.setConnectTimeout(connectTimeout)\nclient.addHostKeyVerifier(new PromiscuousVerifier())\n\ntry { client.loadKnownHosts() } catch (ex) { /* No Known Hosts File */ }\n\ndef state = States.RUNNING\ndef session = null\ndef shell = null\n\ndef log = []\ndef stdout = \"\"\n\ndef startTime = System.currentTimeMillis()\n\ntry {\n\tlog.push(\"INFO : Connecting to [${host}]\")\n\tclient.connect(host, port.toInteger())\n\n\tif(pKey && new File(pKey).exists()) {\n\t\tclient.authPublickey(user, client.loadKeys(pKey))\n\t} else {\n\t\tclient.auth(user,\n\t\t\t\t\tnew AuthPassword(PasswordUtils.createOneOff(pass.toCharArray())), \n\t\t\t\t\tnew AuthKeyboardInteractive(new PasswordResponseProvider(PasswordUtils.createOneOff(pass.toCharArray()))),\n\t\t\t\t\tnew AuthNone())\n\t}\n\n\tsession = client.startSession()\n\tlog.push(\"INFO : Allocating [${pty}] Pseudoterminal\")\n\tsession.allocatePTY(pty, 80, 24, 0, 0, Collections.<PTYMode, Integer> emptyMap());\n\t\n\tshell = session.startShell()\n\n\tdef txStream = new PrintStream(shell.getOutputStream(), true)\n\tdef rxStream = shell.getInputStream()\n\n\tdef ansiMode = false\n\tdef cursor = 0\n\tdef inputData = new byte[Math.max(5242880, Settings.getSettingInt(Settings.CONFIGURATION_MAX_LENGTH, 5242880))]\n\n\tdef prompt = customPrompt ?: \"\"\n\tdef enablePrompt = \"\"\n\tdef promptIndex = -1\n\tdef promptValidated = false\n\tdef filteredPrompt = false\n\n\tdef formattingCommands = fmtc\n\tdef collectingCommands = [wild]\n\tdef escalationCommands = enblePass ? [escalationCommand] : []\n\tdef extraLoginCommands = loginPass ? [\"login\"] : []\n\tdef credentialCommands = [pass] // Used to store auth crednetials so we don't attempt them multiple times\n\n\tdef lastCollectionCommand = \"\"\n\tdef lastCollectionIndex = -1\n\tdef lastSize = -1\n\n\tdef readTimeoutEnd = System.currentTimeMillis() + readingTimeout\n\n\twhile(state == States.RUNNING) {\n\t\tdef availableBytes = rxStream.available()\n\n\t\tif(availableBytes > 0) {\n\t\t\tif(cursor + availableBytes >= inputData.length) {\n\t\t\t\tlog.push(\"ERROR : Size of output greater than configured maximum\")\n\t\t\t\tstats[\"rawSize\"] = cursor + availableBytes\n\t\t\t\tstate = States.FAILED\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tcursor += rxStream.read(inputData, cursor, Math.min(availableBytes, inputData.length - cursor))\n\n\t\t\treadTimeoutEnd = System.currentTimeMillis() + readingTimeout\n\n\t\t\tstdout = new String(inputData[0..<cursor] as byte[])\n\n\t\t\tdef endLineIndex = 0\n\t\t\tdef endLineSize = 0\n\n\t\t\tnewLineCharacters.each { lineEnd->\n\t\t\t\tdef lineEndIndexCheck = stdout.lastIndexOf(lineEnd)\n\n\t\t\t\tif(lineEndIndexCheck > endLineIndex &&\n\t\t\t\t lineEndIndexCheck + lineEnd.length() < stdout.size()) {\n\t\t\t\t\tendLineIndex = lineEndIndexCheck\n\t\t\t\t\tendLineSize = lineEnd.length()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(stdout.size() != lastSize) {\n\t\t\t\tlastSize = stdout.size()\n\t\t\t\tdef lastLn = stdout.substring(endLineIndex + endLineSize)\n\n\t\t\t\tif(ansiMode || lastLn.contains(\"\\u001B\")) {\n\t\t\t\t\tif(!ansiMode) {\n\t\t\t\t\t\tansiMode = true\n\t\t\t\t\t\tlog.push(\"INFO : Entering ANSI mode\")\n\t\t\t\t\t}\n\t\t\t\t\tlastLn = lastLn.replaceAll(ansiEscapeRegex,\"\")\n\t\t\t\t}\n\n\t\t\t\tlastLn = lastLn.trim()\n\t\t\t\t\n\t\t\t\tif(filteredPrompt && lastLn ==~ /.*\\d+:\\d+:\\d+:.*/) { // If times may be involved, strip all times from line\n\t\t\t\t\tlog.push(\"INFO : Line [${lastLn}] needs edit for filtered prompt\")\n\t\t\t\t\tlastLn = lastLn.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\tlog.push(\"INFO : Line changed to ${lastLn}\")\n\t\t\t\t}\n\n\t\t\t\tdef isPrompt = false\n\n\t\t\t\tif(lastLn ==~ /(?i)^(PLEASE ENTER LOGIN NAME|USER\\s?(NAME)?)\\s*:.*/) {\n\t\t\t\t\tlog.push(\"INFO : User Line\")\n\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\tlog.push(\"INFO : Sending Username\")\n\t\t\t\t\t\ttxStream.print(\"${user}\\n\")\n\t\t\t\t\t}\n\t\t\t\t} else if(lastLn ==~ /(?i)^(PLEASE ENTER )?PASS(WORD)?\\s*:.*/) {\n\t\t\t\t\tlog.push(\"INFO : Pass Line\")\n\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\tif(credentialCommands) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Password\")\n\t\t\t\t\t\t\ttxStream.print(\"${credentialCommands.pop()}\\n\")\n\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if(lastLn ==~ /(?i).*PRESS (ENTER|ANY KEY) TO CONTINUE.*/) {\n\t\t\t\t\tlog.push(\"INFO : Press key Line\")\n\t\t\t\t\ttxStream.print(\"\\n\")\n\t\t\t\t} else if(lastLn ==~ /(?i)<?\\s*-+\\s*MORE\\s*(-+|or \\(?q\\)?uit)\\s*>?.*/) {\n\t\t\t\t\tlog.push(\"INFO : More Line\")\n\t\t\t\t\ttxStream.print(\" \")\n\t\t\t\t} else if((prompt && lastLn == prompt) || (enablePrompt && lastLn == enablePrompt)) {\n\t\t\t\t\tdef newPromptIndex = stdout.lastIndexOf(prompt)\n\n\t\t\t\t\tif(enablePrompt) { // Check if there is a more recent EnablePrompt\n\t\t\t\t\t\tnewPromptIndex = Math.max(newPromptIndex, stdout.lastIndexOf(enablePrompt))\n\t\t\t\t\t}\n\n\t\t\t\t\tif(newPromptIndex != promptIndex || filteredPrompt) {\n\t\t\t\t\t\tlog.push(\"INFO : Prompt Line\")\n\t\t\t\t\t\tpromptIndex = newPromptIndex\n\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.push(\"WARN : Duplicate Prompt Index\")\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdef customFound = false\n\n\t\t\t\t\tcustomLineResponse.each { match, response->\n\t\t\t\t\t\tif(lastLn ==~ match) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Custom Response Line Found - ${lastLn}\")\n\t\t\t\t\t\t\ttxStream.print(response)\n\t\t\t\t\t\t\tcustomFound = true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!customFound) {\n\t\t\t\t\t\tlog.push(\"INFO : Unknown Line - ${lastLn}\")\n\n\t\t\t\t\t\tif(!prompt && !lastLn.isAllWhitespace()) {\n\t\t\t\t\t\t\tif(lastLn.length() < promptMaxSize) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Assuming line is prompt - ${lastLn}\")\n\t\t\t\t\t\t\t\tprompt = lastLn\n\t\t\t\t\t\t\t\tpromptIndex = stdout.lastIndexOf(prompt)\n\t\t\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Line greater than ${promptMaxSize} characters. Unlikely to be a prompt.\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(isPrompt) { // A prompt is waiting for input. We do our actions here.\n\t\t\t\t\tif(!prompt) { // If we found a prompt with our prompt line cleared, update it\n\t\t\t\t\t\tprompt = enablePrompt\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tif(promptFilter && !promptValidated) {\n\t\t\t\t\t\tif(prompt ==~ /.*\\d+:\\d+:\\d+:.*/) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Prompt contains time\")\n\t\t\t\t\t\t\tprompt = prompt.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\t\t\tlog.push(\"INFO : Time removed from prompt [${prompt}]\")\n\t\t\t\t\t\t\tfilteredPrompt = true\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tpromptChecked = true\n\t\t\t\t\t}\n\n\t\t\t\t\tif(extraLoginCommands) {\n\t\t\t\t\t\tdef command = extraLoginCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Performing Second Login\")\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\tcredentialCommands = [loginPass]\n\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t} else if(escalationCommands) {\n\t\t\t\t\t\tdef command = escalationCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Sending Escalation command\")\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\n\t\t\t\t\t\tif(command == \"enable\") {\n\t\t\t\t\t\t\tenablePrompt = \"${prompt[0..-2]}#\"\n\t\t\t\t\t\t\tlog.push(\"INFO : Setting enable prompt to - ${enablePrompt}\")\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsleep(1000) // Prompt change unknown. Wait for change.\n\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcredentialCommands = [enblePass]\n\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t} else if(formattingCommands) {\n\t\t\t\t\t\tdef command = formattingCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Sending Formatting command - ${command}\")\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t}else if (collectingCommands) {\n\t\t\t\t\t\tdef command = collectingCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Sending Collecting command - ${command}\")\n\t\t\t\t\t\tlastCollectionIndex = cursor\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.push(\"INFO : Command output finished\")\n\n\t\t\t\t\t\tdef out = stdout.substring(lastCollectionIndex)\n\n\t\t\t\t\t\tif(ansiMode) {\n\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t .replaceAll(/\\n.*\\e\\[2(J|K)/, \"\\n\")\n\t\t\t\t\t\t\t\t\t .split(/\\n|\\r\\n|\\e\\[(1|2)?(J|K)/)\n\t\t\t\t\t\t\t\t\t .tail() // Remove first (prompt) line\n\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t .replaceAll(ansiEscapeRegex, \"\")\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t .split(\"\\n\")\n\t\t\t\t\t\t\t\t\t .tail()\n\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\t\t\t\tout = \"\"\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(out) {\n\t\t\t\t\t\t\tprint out\n\n\t\t\t\t\t\t\tstate = States.SUCCESSFUL\n\t\t\t\t\t\t\tstats[\"size\"] = out.length()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.push(\"ERROR : Captured output was invalid\")\n\t\t\t\t\t\t\tlog.push(\"--- Command Result ---\")\n\t\t\t\t\t\t\tlog.push(stdout.substring(lastCollectionIndex))\n\t\t\t\t\t\t\tlog.push(\"----------------------\")\n\t\t\t\t\t\t\tstate = States.INVALID\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(System.currentTimeMillis() > readTimeoutEnd && state != States.SUCCESSFUL) { // Timeout\n\t\t\tlog.push(\"ERROR : Timeout looking for valid line\")\n\t\t\tlog.push(\"--- Standard Output ---\")\n\t\t\tlog.push(stdout)\n\t\t\tlog.push(\"-----------------------\")\n\n\t\t\tstate = States.FAILED\n\t\t}\n\n\n\t\tif(System.currentTimeMillis() > startTime + maximumTimeout) { // Timeout\n\t\t\tlog.push(\"ERROR : Maximum timeout reached\")\n\t\t\t\n\t\t\tstate = States.FAILED\n\t\t}\n\n\t\tif(state != States.RUNNING) { // Collection finished. Quit out safely.\n\t\t\tlog.push(\"INFO : Collection finished with ${state} state\")\n\t\t\ttxStream.print(\"\\u0003\") // Send a SIGINT to interupt anything running.\n\n\t\t\tendc.each {\n\t\t\t\ttry {\n\t\t\t\t\tlog.push(\"INFO : Sending End command - ${it}\")\n\t\t\t\t\ttxStream.print(\"${it}\\n\")\n\t\t\t\t} catch (ex) {\n\t\t\t\t\tlog.push(\"WARN : Failed to send - ${it}\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\n\t\tThread.sleep(1)\n\t}\n} catch (e) {\n\tlog.push(\"ERROR : Exception - ${e.message}\")\n} finally {\n\ttry {\n\t\tshell?.close()\n\t\tsession?.close()\n\t\tclient?.disconnect()\n\t} catch (e) {\n\t\tlog.push(\"ERROR : Exception Closing - ${e.message}\")\n\t}\n\n\tstats[\"time\"] = System.currentTimeMillis()\n\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\tstats[\"state\"] = state\n\tstats[\"log\"] = log\n\tstats[\"rawSize\"] = stats[\"rawSize\"] ?: stdout.length()\n\n\tif(state != States.SUCCESSFUL) {\n\t\tprintln \"--- Collection Failure Log ---\"\n\t\tprint log.join(\"\\n\")\n\t}\n\n\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\tfileCache.write(json)\n\n\treturn (state == States.SUCCESSFUL) ? 0 : 1\n}"}, "configChecks": [{"name": "Check", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": ["(1[0-9]|2[0-4]):\\d\\d?:\\d\\d:?\\d*.*[>#$]$", "(?i)^\\s*FREE MEMORY:.*", "(?i)^\\s*DAYS TO EXPIRATION", "(?i)^\\s*SET (PASSW(OR)?D)|(PSKSECRET)|(MD5-KEY)|(ENC)", "(?i)^#", "(?i)^.*UP(TIME)?\\s*(IS)?:?\\s*\\d+\\s*(YEAR|WEEK|DAY|HOUR|MINUTE)S?.*", "^!", "(?i)(MON|TUE|WED|THU|FRI|SAT|SUN) (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) \\d+ \\d+:\\d+\\d+:\\d+\\.?\\d* [A-Z]*", "(?i)USING \\d+ OUT OF \\d+ BYTES", "(?i)^SYSTEM RESTARTED AT", "(?i)UP\\s?TIME", "(?i)^CURRENT CONFIGURATION\\s*:", "(?i)^NTP CLOCK-PERIOD"], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": true}, "clearAfterAck": true, "clearAfterMin": 0}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Microsoft_Azure_VirtualDesktopSessionHosts (337)

{"name": "Microsoft_Azure_VirtualDesktopSessionHosts", "description": "Monitors the health of Azure virtual desktop session hosts.", "appliesTo": "hasCategory(\"Azure/VirtualDesktop\")", "searchKeywords": "virtual desktop,microsoft,azure", "displayedAs": "Azure Virtual Desktop Session Hosts", "collectionInterval": "3m", "collectionMethod": "azurevirtualdesktopsessionhosts", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_azurevirtualdesktopsessionhosts", "discoveryInterval": "60m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "groupMethod": "none"}, "datapoints": [{"name": "sessions", "description": "Number of sessions on the SessionHost.", "interpretMethod": "none", "interpretExpr": "sessions", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "status", "description": "Status for a SessionHost:\n\n1=Available,\n2=Upgrading,\n3=Shutdown,\n4=Disconnected,\n5=Domain Trust Relationship Lost,\n6=FS Logix Not Healthy,\n7=Need Assistance,\n8=No Heartbeat,\n9=Not Joined to Domain,\n10=SXS Stack Listener Not Ready,\n11=Unavailable,\n12=Upgrade Failed,\n\nMore details: https://docs.microsoft.com/en-us/rest/api/desktopvirtualization/session-hosts/list#status", "interpretMethod": "none", "interpretExpr": "status", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "1", "max": "12", "threshold": "> 2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The Azure Virtual Desktop on ##HOST## is reporting a status of ##VALUE## on ##INSTANCE##, placing the device into ##LEVEL## state.\n\nStatus Codes:\n\n1=Available,\n2=Disconnected,\n3=Domain Trust Relationship Lost,\n4=FS Logix Not Healthy,\n5=Need Assistance,\n6=No Heartbeat,\n7=Not Joined to Domain,\n8=Shutdown,\n9=SXS Stack Listener Not Ready,\n10=Unavailable,\n11=Upgrade Failed,\n12=Upgrading\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "timeFromLastHeartbeat", "description": "Last heart beat from SessionHost in seconds.", "interpretMethod": "none", "interpretExpr": "timeFromLastHeartbeat", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Number of Session", "title": "Number of Sessions", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "sessions", "datapointName": "sessions", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Sessions", "color": "green", "datapointName": "sessions", "isVirtual": false}]}, {"name": "Seconds Since Last Heartbeat", "title": "Seconds Since Last Heartbeat", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "timeFromLastHeartbeat", "datapointName": "timeFromLastHeartbeat", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Last Heartbeat", "color": "orange2", "datapointName": "timeFromLastHeartbeat", "isVirtual": false}]}, {"name": "SessionHost Status", "title": "SessionHost Status", "verticalLabel": "status code", "min": 0.0, "max": 13.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "status", "datapointName": "status", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "status", "color": "maroon", "datapointName": "status", "isVirtual": false}]}]}

×DataSource: Salesforce_Lightning_Usage_By_Browser_Chrome (576)

{"name": "Salesforce_Lightning_Usage_By_Browser_Chrome", "description": "Return Lightning Experience usage results grouped by browser instance.Metrics to breakdown page load times by user into quartiles.", "appliesTo": "hasCategory(\"saas/Salesforce\") && saas.accountType != \"sandbox\"", "searchKeywords": "salesforce,cloud,saas,ert,crm", "displayedAs": "Salesforce Lightning Usage By Chorme Browser", "collectionInterval": "1d", "collectionMethod": "saassalesforcesoqlquery", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"dateColumn": "MetricsDate", "soqlEntity": "LightningUsageByBrowserMetrics", "whereClause": "Browser = 'CHROME'", "groupByClause": "MetricsDate"}, "datapoints": [{"name": "EptBin3To5", "description": "Number of times that a page loaded between 3-5 seconds.", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"SUM(EptBin3To5)\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "EptBin5To8", "description": "Number of times that a page loaded between 5-8 seconds.", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"SUM(EptBin5To8)\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "EptBin8To10", "description": "Number of times that a page loaded between 8-10 seconds.", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"SUM(EptBin8To10)\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "EptBinOver10", "description": "Number of times that a page loaded over 10 seconds.", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"SUM(EptBinOver10)\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "EptBinUnder3", "description": "Number of times that a page loaded under 3 seconds.", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"SUM(EptBinUnder3)\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PageCount", "description": "Number of pages.", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"COUNT(PageName)\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RecordCountEPT", "description": "Number of records for a page/browser where the valid EPT was recorded.", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"SUM(RecordCountEPT)\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SumEPT", "description": "Sum of the EPT values for page/browser.", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"SUM(SumEPT)\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalCount", "description": "Total records for a page/browser.", "interpretMethod": "none", "interpretExpr": "{\"columnName\":\"SUM(TotalCount)\"}", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Record Counts", "title": "Record Counts", "verticalLabel": "count", "min": 0.0, "displayPriority": 30, "timeScale": "1month", "scale1024": false, "rigid": false, "datapoints": [{"name": "PageCount", "datapointName": "PageCount", "consolidationFn": "average"}, {"name": "RecordCountEPT", "datapointName": "RecordCountEPT", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Page Count", "color": "silver", "datapointName": "PageCount", "isVirtual": false}, {"type": "line", "legend": "Record Count", "color": "green", "datapointName": "RecordCountEPT", "isVirtual": false}]}, {"name": "User Count", "title": "User Count", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1month", "scale1024": false, "rigid": false, "datapoints": [{"name": "TotalCount", "datapointName": "TotalCount", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "User Count", "color": "blue", "datapointName": "TotalCount", "isVirtual": false}]}, {"name": "User Count by Page Load Times", "title": "User Count by Page Load Times", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1month", "scale1024": false, "rigid": false, "datapoints": [{"name": "EptBin3To5", "datapointName": "EptBin3To5", "consolidationFn": "average"}, {"name": "EptBin5To8", "datapointName": "EptBin5To8", "consolidationFn": "average"}, {"name": "EptBin8To10", "datapointName": "EptBin8To10", "consolidationFn": "average"}, {"name": "EptBinOver10", "datapointName": "EptBinOver10", "consolidationFn": "average"}, {"name": "EptBinUnder3", "datapointName": "EptBinUnder3", "consolidationFn": "average"}, {"name": "SumEPT", "datapointName": "SumEPT", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Page Time 3-5 seconds", "color": "teal", "datapointName": "EptBin3To5", "isVirtual": false}, {"type": "line", "legend": "Page Time 5-8 seconds", "color": "olive", "datapointName": "EptBin5To8", "isVirtual": false}, {"type": "line", "legend": "Page Time 8-10 seconds", "color": "orange2", "datapointName": "EptBin8To10", "isVirtual": false}, {"type": "line", "legend": "Page Time >10 seconds", "color": "red2", "datapointName": "EptBinOver10", "isVirtual": false}, {"type": "line", "legend": "Page Time <3 seconds", "color": "purple", "datapointName": "EptBinUnder3", "isVirtual": false}, {"type": "line", "legend": "SumEPT", "color": "black", "datapointName": "SumEPT", "isVirtual": false}]}]}

×DataSource: Veeam_BackupAndReplication_ScaleOutRepositories (664)

{"name": "Veeam_BackupAndReplication_ScaleOutRepositories", "description": "Veeam Backup Repositories performance metrics.", "appliesTo": "hasCategory(\"VeeamBackupAndReplicationPowerShell\")", "searchKeywords": "repository,veeam,backup and replication", "technicalNotes": "PropertySource addCategory_Veeam_BackupAndReplication_PowerShell must be installed and working. \n\nRequirements:\n- PowerShell remoting must also be enabled from the collector to the target device.\n- Collector user must have access permission or credential properties must be provided as either of the following:\n-- Veeam (veeam.user and veeam.pass)\n-- WMI (wmi.user and wmi.pass)\n\nPrecedence is given to the Veeam properties if both are defined.", "displayedAs": "Veeam ScaleOut Repositories", "collectionInterval": "10m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "15m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": true, "params": {"type": "powershell", "content": "<# \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved. #>\n\n$hostname = '##system.hostname##'\n$categories = '##system.categories##'\n\n# If the hostname is an IP address query DNS for the FQDN\nif($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\"){\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName\n}\n\n$veeam_user = @'\n##veeam.user##\n'@\n$veeam_pass = @'\n##veeam.pass##\n'@\n$wmi_user = @'\n##wmi.user##\n'@\n$wmi_pass = @'\n##wmi.pass##\n'@\n\n#Check if we have valid veeam credentials, if we need to use wmi, or if we have nothing\n[bool]$UseCredentials = $true\nif([string]::IsNullOrEmpty($veeam_user) -OR $veeam_user -like \"*veeam.user*\"){\n if(-NOT([string]::IsNullOrEmpty($wmi_user) -OR $wmi_user -like \"*wmi.user*\")){\n $veeam_user = $wmi_user\n }else{\n $UseCredentials = $false\n }\n}\nif($UseCredentials -AND ([string]::IsNullOrEmpty($veeam_pass) -OR $veeam_pass -like \"*veeam.pass*\")){\n if(!([string]::IsNullOrEmpty($wmi_pass) -OR $wmi_pass -like \"*wmi.pass*\")){\n $veeam_pass = $wmi_pass\n }else{\n $UseCredentials = $false\n }\n}\n\nfunction Get-VeeamConnection {\n Param (\n # Hostname of the Veeam Server we are connecting to.\n [Parameter(Mandatory = $true)]\n [string]\n $VeeamHostname,\n\n # Veeam Username\n [Parameter(Mandatory = $false)]\n [string]\n $VeeamUsername,\n\n # Veeam Password\n [Parameter(Mandatory = $false)]\n [String]\n $VeeamPassword\n )\n\n $max_attempts = 2\n $attempt_sleep = 2\n $current_attempt_count = 0\n\n if($VeeamUsername -and $VeeamPassword){\n $secure_pass = ConvertTo-SecureString -String $VeeamPassword -AsPlainText -Force\n $creds = New-Object -typename System.Management.Automation.PSCredential($VeeamUsername, $secure_pass)\n }\n ## Attempt to acquire a persistent session object. Keep trying until we hit the $max_attempts value.\n while (-Not$veeam_session -and ($current_attempt_count -le $max_attempts)) {\n\n $current_attempt_count++\n if($VeeamUsername -and $VeeamPassword){\n $veeam_session = New-PSSession -ComputerName $VeeamHostname -Credential $creds\n } else{\n $veeam_session = New-PSSession -ComputerName $VeeamHostname\n }\n Start-Sleep -Seconds $attempt_sleep\n #} #Removed the if/else. This is the terminating } for else\n }\n\n ## Ensure that the session was successfully created, otherwise exit.\n if ( -Not $veeam_session ) {\n Write-Host \"Error connecting session. Terminating.\"\n Exit\n }\n Invoke-Command -Session $veeam_session -ScriptBlock {Add-PSSnapin -Name VeeamPSSnapIn -WarningAction SilentlyContinue -ErrorAction SilentlyContinue}\n return $veeam_session\n}\n\n$command = {\n\n $lookupRepo = @{\n \"Ordinal\" = 0\n \"MaintenancePending\" = 1\n \"Maintenance\" = 2\n \"Evacuating\" = 4\n }\n\n $isAd = $true\n\n $soRepos = Get-VBRBackupRepository -ScaleOut -WarningAction SilentlyContinue\n\n if ($soRepos) {\n foreach ($scaleOut in $soRepos)\n {\n $extents = Get-VBRRepositoryExtent -Repository $ScaleOut\n foreach ($extent in $extents) {\n $container = $extent.Repository.GetContainer()\n $extentdetails = [PSCustomObject]@{\n 'RepoName' = $scaleOut.Name\n 'ScaleOutName' = $extent.Name -replace '\\\\', '-'\n 'Size' = $container.CachedTotalSpace.InGigabytes\n 'FreeSpace' = $container.CachedFreeSpace.InGigabytes}\n $reponame = $extentdetails.RepoName\n $wildvalue = $extentdetails.ScaleOutName -replace '\\\\', '-' -replace '[#\\\\:= ]', '_'\n\n if($isAd){\n Write-Host (\"$($wildvalue)##$($wildvalue)##$($extentdetails.RepoName)\")\n } else {\n Write-Host \"$($wildvalue).CachedSize=$($extentdetails.Size)\"\n Write-Host \"$($wildvalue).CachedFreeSpace=$($extentdetails.FreeSpace)\"\n }\n }\n }\n }\n}\n\n## BEGIN MAIN SCRIPT\nif(-not($categories.toLower().Contains('collector'))){\n if ($UseCredentials) {\n $session1 = Get-VeeamConnection -VeeamHostname $hostname -VeeamUsername $veeam_user -VeeamPassword $veeam_pass\n } else {\n $session1 = Get-VeeamConnection -VeeamHostname $hostname\n }\n\n Invoke-Command -Session $session1 -ScriptBlock $command\n}else{\n Add-PSSnapin -Name VeeamPSSnapIn -WarningAction SilentlyContinue -ErrorAction SilentlyContinue\n & $command\n}\n\nif($session1){\n Get-PSSession | Remove-PSSession\n}"}, "groupMethod": "ilp", "groupExpr": "##REPONAME##"}, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2021 - LogicMonitor, Inc. All rights reserved. #>\n\n$hostname = '##system.hostname##'\n$categories = '##system.categories##'\n\n# If the hostname is an IP address query DNS for the FQDN\nif($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\"){\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName\n}\n\n$veeam_user = @'\n##veeam.user##\n'@\n$veeam_pass = @'\n##veeam.pass##\n'@\n$wmi_user = @'\n##wmi.user##\n'@\n$wmi_pass = @'\n##wmi.pass##\n'@\n\n#Check if we have valid veeam credentials, if we need to use wmi, or if we have nothing\n[bool]$UseCredentials = $true\nif([string]::IsNullOrEmpty($veeam_user) -OR $veeam_user -like \"*veeam.user*\"){\n if(-NOT([string]::IsNullOrEmpty($wmi_user) -OR $wmi_user -like \"*wmi.user*\")){\n $veeam_user = $wmi_user\n }else{\n $UseCredentials = $false\n }\n}\nif($UseCredentials -AND ([string]::IsNullOrEmpty($veeam_pass) -OR $veeam_pass -like \"*veeam.pass*\")){\n if(!([string]::IsNullOrEmpty($wmi_pass) -OR $wmi_pass -like \"*wmi.pass*\")){\n $veeam_pass = $wmi_pass\n }else{\n $UseCredentials = $false\n }\n}\n\nfunction Get-VeeamConnection {\n Param (\n # Hostname of the Veeam Server we are connecting to.\n [Parameter(Mandatory = $true)]\n [string]\n $VeeamHostname,\n\n # Veeam Username\n [Parameter(Mandatory = $false)]\n [string]\n $VeeamUsername,\n\n # Veeam Password\n [Parameter(Mandatory = $false)]\n [String]\n $VeeamPassword\n )\n\n $max_attempts = 2\n $attempt_sleep = 2\n $current_attempt_count = 0\n\n if($VeeamUsername -and $VeeamPassword){\n $secure_pass = ConvertTo-SecureString -String $VeeamPassword -AsPlainText -Force\n $creds = New-Object -typename System.Management.Automation.PSCredential($VeeamUsername, $secure_pass)\n }\n ## Attempt to acquire a persistent session object. Keep trying until we hit the $max_attempts value.\n while (-Not$veeam_session -and ($current_attempt_count -le $max_attempts)) {\n\n $current_attempt_count++\n if($VeeamUsername -and $VeeamPassword){\n $veeam_session = New-PSSession -ComputerName $VeeamHostname -Credential $creds\n } else{\n $veeam_session = New-PSSession -ComputerName $VeeamHostname\n }\n Start-Sleep -Seconds $attempt_sleep\n #} #Removed the if/else. This is the terminating } for else\n }\n\n ## Ensure that the session was successfully created, otherwise exit.\n if ( -Not $veeam_session ) {\n Write-Host \"Error connecting session. Terminating.\"\n Exit\n }\n Invoke-Command -Session $veeam_session -ScriptBlock {Add-PSSnapin -Name VeeamPSSnapIn -WarningAction SilentlyContinue -ErrorAction SilentlyContinue}\n return $veeam_session\n}\n\n$command = {\n\n $lookupRepo = @{\n \"Ordinal\" = 0\n \"MaintenancePending\" = 1\n \"Maintenance\" = 2\n \"Evacuating\" = 4\n }\n\n $isAd = $false\n\n $soRepos = Get-VBRBackupRepository -ScaleOut -WarningAction SilentlyContinue\n\n if ($soRepos) {\n foreach ($scaleOut in $soRepos)\n {\n $extents = Get-VBRRepositoryExtent -Repository $ScaleOut\n foreach ($extent in $extents) {\n $container = $extent.Repository.GetContainer()\n\n $extentdetails = [PSCustomObject]@{\n 'RepoName' = $scaleOut.Name\n 'ScaleOutName' = $extent.Name -replace '\\\\', '-'\n 'Size' = $container.CachedTotalSpace.Inbytes\n 'FreeSpace' = $container.CachedFreeSpace.Inbytes\n }\n\n $reponame = $extentdetails.RepoName\n $wildvalue = $extentdetails.ScaleOutName -replace '\\\\', '-' -replace '[#\\\\:= ]', '_'\n\n if($isAd){\n Write-Host (\"$($wildvalue)##$($wildvalue)##$($extentdetails.RepoName)\")\n } else {\n Write-Host \"$($wildvalue).CachedSize=$($extentdetails.Size)\"\n Write-Host \"$($wildvalue).CachedFreeSpace=$($extentdetails.FreeSpace)\"\n }\n }\n }\n }\n}\n\n## BEGIN MAIN SCRIPT\nif(-not($categories.toLower().Contains('collector'))){\n if ($UseCredentials) {\n $session1 = Get-VeeamConnection -VeeamHostname $hostname -VeeamUsername $veeam_user -VeeamPassword $veeam_pass\n } else {\n $session1 = Get-VeeamConnection -VeeamHostname $hostname\n }\n\n Invoke-Command -Session $session1 -ScriptBlock $command\n}else{\n Add-PSSnapin -Name VeeamPSSnapIn -WarningAction SilentlyContinue -ErrorAction SilentlyContinue\n & $command\n}\n\nif($session1){\n Get-PSSession | Remove-PSSession\n}"}, "datapoints": [{"name": "CapacityFreeSpace", "description": "Scale out repository free space in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CachedFreeSpace", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CapacityTotalSpace", "description": "Scale out repository total space in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.CachedSize", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CapacityUsedSpace", "description": "Scale out repository used space in bytes.", "interpretMethod": "expression", "interpretExpr": "((CapacityTotalSpace)-(CapacityFreeSpace))", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CapacityUsedSpacePercent", "description": "Scale out repository used space percentage.", "interpretMethod": "expression", "interpretExpr": "(CapacityUsedSpace/CapacityTotalSpace)*100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Cached Free Space", "title": "Cached Free Space", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "CapacityFreeSpace", "datapointName": "CapacityFreeSpace", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Free Space", "color": "green", "datapointName": "CapacityFreeSpace", "isVirtual": false}]}, {"name": "Cached Total Space", "title": "Cached Total Space", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "CachedTotalSpace", "datapointName": "CapacityTotalSpace", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Total Space", "color": "blue", "datapointName": "CachedTotalSpace", "isVirtual": false}]}, {"name": "Cached Used Percent", "title": "Cached Used Percent", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CachedUsedPercent", "datapointName": "CapacityUsedSpacePercent", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Used Percent", "color": "orange", "datapointName": "CachedUsedPercent", "isVirtual": false}]}, {"name": "Cached Used Space", "title": "Cached Used Space", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "CachedUsedSpace", "datapointName": "CapacityUsedSpace", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Used Space", "color": "black", "datapointName": "CachedUsedSpace", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Repositories by Cached Free Space", "title": "Top 10 Repositories by Cached Free Space", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "CapacityFreeSpace", "datapointName": "CapacityFreeSpace", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "CapacityFreeSpace", "isVirtual": false}]}, {"name": "Top 10 Repositories by Cached Total Space", "title": "Top 10 Repositories by Cached Total Space", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "CachedTotalSpace", "datapointName": "CapacityTotalSpace", "consolidationFn": "average", "aggregateMethod": "average"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "CachedTotalSpace", "isVirtual": false}]}, {"name": "Top 10 Repositories by Cached Used Space", "title": "Top 10 Repositories by Cached Used Space", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "CapacityUsedSpace", "datapointName": "CapacityUsedSpace", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "CapacityUsedSpace", "isVirtual": false}]}, {"name": "Total Available Capacity", "title": "Total Available Capacity", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "aggregated": true, "scale1024": true, "rigid": false, "datapoints": [{"name": "CapacityFreeSpace", "datapointName": "CapacityFreeSpace", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "CapacityFreeSpace", "isVirtual": false}]}, {"name": "Total Capacity Usage of All Repositories", "title": "Total Capacity Usage of All Repositories", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "aggregated": true, "scale1024": true, "rigid": false, "datapoints": [{"name": "CapacityUsedSpace", "datapointName": "CapacityUsedSpace", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "black", "datapointName": "CapacityUsedSpace", "isVirtual": false}]}, {"name": "Total Capacity of All Repositories", "title": "Total Capacity of All Repositories", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "aggregated": true, "scale1024": true, "rigid": false, "datapoints": [{"name": "CapacityTotalSpace", "datapointName": "CapacityTotalSpace", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "purple", "datapointName": "CapacityTotalSpace", "isVirtual": false}]}]}

×DataSource: Cisco_UCS_IMCDisks (277)

{"name": "Cisco_UCS_IMCDisks", "description": "Monitors performance metrics for Cisco UCS disks on IMC servers.", "appliesTo": "hasCategory(\"CiscoIMC\")", "searchKeywords": "cimc,ucs,disks,cisco,unified computing system", "technicalNotes": "These modules require a minimum collector version (30.000) and additonal collector configurations. Review support doc for details: https://www.logicmonitor.com/support/monitoring/networking-firewalls/cisco-ucs-monitoring\nRequires the following host properties:\n- ucs_api.mgmt_host\n- ucs_api.user\n- ucs_api.pass\n\n\nNote that disk refers to the physical disk and drive refers to the disk enclosure.", "displayedAs": "UCS Disks", "collectionInterval": "1m", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\nimport com.santaba.agent.util.script.ScriptCache\n\n// To run in debug mode, set to true\ndef debug = false\n// To save collector logs, set to true\ndef log = false\n\ndef host = hostProps.get(\"ucs_api.mgmt_host\") ?: hostProps.get(\"system.hostname\") // CIMC devices will typically use system.hostname\ndef user = hostProps.get(\"ucs_api.user\")\ndef pass = hostProps.get(\"ucs_api.pass\")\ndef port = hostProps.get(\"ucs_api.port\") ?: \"443\"\n\ndef eri_prefix = hostProps.get(\"auto.ucs.system_name\") ?: \"\"\ndef keyNamespace = hostProps.get(hostProps.get(\"topo.namespace\", \"\"), \"\")\ndef keyBlacklist = hostProps.get(\"topo.blacklist\", \"\").tokenize(\",\")\n\n// Collector version 30.000 or higher required for script cache and snippets\ndef collectorCache = ScriptCache.getCache()\ndef modLoader\ntry {\n modLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n}\ncatch (Exception e) {\n modLoader = new GroovyShell(getBinding()).parse(Snippets.getLoader())\n}\n\ndef lmUcs = modLoader.load(\"cisco.ucs\", \"0\") // Load Cisco UCS module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\ndef url = \"http${port == '80' ? '' : 's'}://${host}:${port}/nuova\"\n\ndef auto_props = [\n \"bootable\" : \"bootable\",\n \"disk_model\" : \"model\",\n \"disk_serial\" : \"serial\",\n \"disk_vendor\" : \"vendor\",\n \"disk_type\" : \"deviceType\",\n \"disk_sled_type\" : \"variantType\",\n \"disk_link_speed\" : \"linkSpeed\",\n \"disk_firmware_version\" : \"deviceVersion\",\n \"disk_hw_revision\" : \"revision\",\n \"disk_protocol\" : \"connectionProtocol\",\n \"disk_lsi_disk_connection\": \"encAssociation\",\n \"disk_size\" : \"size\",\n \"disk_raw_size\" : \"rawSize\",\n \"disk_logical_block_size\" : \"blockSize\",\n \"disk_physical_block_size\": \"physicalBlockSize\",\n \"disk_blocks\" : \"numberOfBlocks\"\n]\n\n// Get an XML API authentication cookie\ndef cookie = lmUcs.getCachedCookie(collectorCache, host, url, debug, log)\n\n// If cookie is not a string, something went wrong and we should not continue\nif (cookie.getClass() != String) {\n println \"Issue occurred with cookie. Run script in debug mode for more information.\"\n lmUcs.LMDebugPrint(\"Cookie not retrieved from function call\", debug)\n lmUcs.LMDebugLog(\"Cookie not retrieved from function call\", log)\n return 1\n}\n\n// Request metrics from the API\ndef request = lmUcs.getXMLbyClass(url,\"storageLocalDisk\", cookie, false, debug)\n\nrequest.storageLocalDisk.each { disk ->\n def dn = lmEmit.sanitizeWildvalue(disk.@dn.toString())\n def model = disk.@model.toString()\n def ilps = [:]\n\n def eri = []\n\n auto_props.each { k, v ->\n ilps[\"auto.ucs.cimc.${k}\"] = disk['@' + v]\n if (k.toString() == \"disk_serial\" && disk['@' + v] && disk['@' + v] != \"\") {\n eri << disk['@' + v].toString()\n }\n }\n\n def owner = \"\"\n split_name = dn.split(\"/\")\n\n if (dn.contains(\"chassis\")) {\n owner = \"${split_name[1]}/${split_name[2]}\"\n }\n else if (dn.contains(\"rack-unit\")) {\n owner = \"${split_name[1]}\"\n }\n\n if (eri_prefix && dn) { eri << \"${eri_prefix}-${dn}\" }\n\n ilps[\"auto.ucs.owner\"] = owner\n ilps[\"predef.externalResourceID\"] = eriPreProcessor(eri, keyNamespace, keyBlacklist)\n ilps[\"predef.externalResourceType\"] = \"VirtualDisk\"\n\n // Remove ilps with empty/null values\n def cleanILPs = ilps.findAll{ k,v -> (v != null && v != \"\") }\n\n // Create instance with dn as wildvalue and wildalias, model as description, and cleanILPs as ilps\n lmEmit.instance(dn, dn, model, cleanILPs)\n}\n\nreturn 0\n\n\ndef eriPreProcessor(List eriList, String namespace, List blacklist) {\n def output = []\n eriList.each { eri ->\n eri = eri.toLowerCase()\n eri = eri.replace(\",\", \"_\")\n if (!blacklist.contains(eri)) {\n if (namespace) {\n namespace = namespace.replace(\",\", \"_\").replace(\"&\", \"and\")\n eri = \"${namespace}::${eri}\"\n }\n output << eri\n }\n }\n return output.join(\",\")\n}"}, "groupMethod": "ilp", "groupExpr": "auto.ucs.owner"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\nimport com.santaba.agent.util.script.ScriptCache\n\n// To run in debug mode, set to true\ndef debug = false\n// To save collector logs, set to true\ndef log = false\n\ndef host = hostProps.get(\"ucs_api.mgmt_host\") ?: hostProps.get(\"system.hostname\") // CIMC devices will typically use system.hostname\ndef user = hostProps.get(\"ucs_api.user\")\ndef pass = hostProps.get(\"ucs_api.pass\")\ndef port = hostProps.get(\"ucs_api.port\") ?: \"443\"\n\n// Collector version 30.000 or higher required for script cache and snippets\ndef collectorCache = ScriptCache.getCache()\ndef modLoader\ntry {\n modLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n}\ncatch (Exception e) {\n modLoader = new GroovyShell(getBinding()).parse(Snippets.getLoader())\n}\n\ndef lmUcs = modLoader.load(\"cisco.ucs\", \"0\") // Load Cisco UCS module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\ndef url = \"http${port == '80' ? '' : 's'}://${host}:${port}/nuova\"\n\ndef drive_state_map = [\n \"\" : 0, // 0x00000000u (none)\n \"online\" : 1, // CIMC response\n \"securityCapable\": 1, // 0x00000001u\n \"securityEnabled\": 2, // 0x00000002u\n \"secured\" : 3, // 0x00000004u\n \"locked\" : 4, // 0x0000008u\n \"foreignSecured\" : 5 // 0x0000016u\n]\n\n// Get an XML API authentication cookie\ndef cookie = lmUcs.getCachedCookie(collectorCache, host, url, debug, log)\n\n// If cookie is not a string, something went wrong and we should not continue\nif (cookie.getClass() != String) {\n println \"Issue occurred with cookie. Run script in debug mode for more information.\"\n lmUcs.LMDebugPrint(\"Cookie not retrieved from function call\", debug)\n lmUcs.LMDebugLog(\"Cookie not retrieved from function call\", log)\n return 1\n}\n\n// Request metrics from the API\ndef request = lmUcs.getXMLbyClass(url, \"storageLocalDisk\", cookie, false, debug)\n\nrequest.storageLocalDisk.each { disk ->\n def dn = lmEmit.sanitizeWildvalue(disk.@dn.toString())\n\n lmEmit.dp(dn, \"drive_state\", drive_state_map[disk.@driveState])\n}\n\nreturn 0"}, "datapoints": [{"name": "driveState", "description": "Status of the disk drive. \nStatus codes:\n\n0=none (0x00000000u), \n1=securityCapable (0x00000001u), \n2=securityEnabled (0x00000002u), \n3=secured (0x00000004u), \n4=locked (0x0000008u), \n5=foreignSecured (0x0000016u)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.drive_state", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "5", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Drive State", "title": "Drive State", "verticalLabel": "status code", "min": 0.0, "max": 6.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "driveState", "datapointName": "driveState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "State", "color": "fuchsia", "datapointName": "driveState", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top Drives by State", "title": "Top Drives by State", "verticalLabel": "status code", "min": 0.0, "max": 6.0, "displayPriority": 2, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "driveState", "datapointName": "driveState", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "driveState", "isVirtual": false}]}]}

×DataSource: Win2k12_HyperV_HypervisorMemory (641)

{"name": "Win2k12_HyperV_HypervisorMemory", "description": "HyperV Hypervisor Available Memory and Average Pressure for Systems with more than one node for a VMM. Single Node memory is still in the HyperV_HypervisorStats. (this was done for backward compatability)\nWin2k12 and later.", "appliesTo": "isWindows() && !(hasCategory(\"WSFC_VNN\") || hasCategory(\"NLB_VNN\"))", "searchKeywords": "virtualization,os,hypervisor,windows,hyperv", "displayedAs": "HyperV Hypervisor Multinode Memory", "collectionInterval": "2m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = '##SYSTEM.HOSTNAME##'\n$collectorName = hostname\n$winrmenabled = '##AUTO.WINRM##'\n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\") {\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName\n}\n\n$SessionParams = @{\n ErrorAction = 'Stop'\n}\n$Opt = New-CimSessionOption -Protocol Dcom\n#-----Determine the type of query to make-----\n# check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($hostname -match $collectorName) {\n #Do nothing\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($wmi_user) -and [string]::IsNullOrWhiteSpace($wmi_pass)) -or (($wmi_user -like '*WMI.USER*') -and ($wmi_pass -like '*WMI.PASS*'))) {\n $SessionParams.ComputerName = $hostname\n\n if ($winrmenabled -notlike 'enabled') {\n $SessionParams.SessionOption = $Opt\n }\n} else {\n $SessionParams.ComputerName = $hostname\n # yes. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $wmi_pass -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $wmi_user, $remote_pass;\n $SessionParams.Credential = $remote_credential\n\n if ($winrmenabled -notlike 'enabled') {\n $SessionParams.SessionOption = $Opt\n }\n}\n\n$session = New-CimSession @SessionParams\n\n$os_version = Get-CimInstance -CimSession $Session -ClassName Win32_OperatingSystem | Select -ExpandProperty Version;\n\n$os_maj_ver, $os_min_ver, $os_point_ver = $os_version.split('.');\n\n# is this a win2k12 or later host\nif (($os_maj_ver -eq 6) -and ($os_min_ver -ge 2))\n{\n $hv_summary = Get-CimInstance -CimSession $Session -ClassName Win32_PerfFormattedData_VmmsVirtualMachineStats_HyperVVirtualMachineHealthSummary -Namespace root\\cimv2\n\n # did we get a result from hypervisory summary\n if ( $hv_summary )\n {\n # yes. write an instance\n $mem_runtime_stats = Get-CimInstance -CimSession $Session `\n -ClassName Win32_PerfFormattedData_BalancerStats_HyperVDynamicMemoryBalancer `\n -Namespace root\\cimv2\n $regexA = '\\(|\\s|\\)|\\\\' \n\n if (($mem_runtime_stats | Select-object Name).count -gt 1 ) {\n # iterate through logical processor stats\n foreach ($metric in $mem_runtime_stats)\n {\n $wildvalue = $metric.name -replace $regexA, '_'\n $wildalias = $metric.name\n $output = $wildvalue+[char]35+[char]35+$wildalias+[char]35+[char]35+[char]35+[char]35+[char]35+[char]35\n $output\n }\n }\n }\n} \nGet-CimSession | Remove-CimSession\nEXIT 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "powershell", "content": "<# \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved. #>\n\n#Requires -Version 3\n#------------------------------------------------------------------------------------------------------------\n# Clears the CLI of any text\nClear-Host\n# Clears memory of all previous variables\nRemove-Variable * -ErrorAction SilentlyContinue\n#------------------------------------------------------------------------------------------------------------\n$wmi_user = @'\n##WMI.USER##\n'@\n$wmi_pass = @'\n##WMI.PASS##\n'@\n$hostname = '##SYSTEM.HOSTNAME##'\n$collectorName = hostname\n$winrmenabled = '##AUTO.WINRM##'\n$regexA = '\\(|\\s|\\)|\\\\' \n\n# If the hostname is an IP address query DNS for the FQDN\nif ($hostname -match \"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b\") {\n $hostname = [System.Net.Dns]::GetHostbyAddress($hostname).HostName\n}\n\n$SessionParams = @{\n ErrorAction = 'Stop'\n}\n$Opt = New-CimSessionOption -Protocol Dcom\n#-----Determine the type of query to make-----\n# check to see if this is monitoring the localhost collector, as we will not need to authenticate.\nif ($hostname -match $collectorName) {\n #Do nothing\n}\n# are wmi user/pass set -- e.g. are these device props either not substiuted or blank\nelseif (([string]::IsNullOrWhiteSpace($wmi_user) -and [string]::IsNullOrWhiteSpace($wmi_pass)) -or (($wmi_user -like '*WMI.USER*') -and ($wmi_pass -like '*WMI.PASS*'))) {\n $SessionParams.ComputerName = $hostname\n\n if ($winrmenabled -notlike 'enabled') {\n $SessionParams.SessionOption = $Opt\n }\n} else {\n $SessionParams.ComputerName = $hostname\n # yes. convert user/password into a credential string\n $remote_pass = ConvertTo-SecureString -String $wmi_pass -AsPlainText -Force;\n $remote_credential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $wmi_user, $remote_pass;\n $SessionParams.Credential = $remote_credential\n\n if ($winrmenabled -notlike 'enabled') {\n $SessionParams.SessionOption = $Opt\n }\n}\n\n$session = New-CimSession @SessionParams\n\n$mem_runtime_stats = Get-CimInstance -CimSession $Session `\n-ClassName Win32_PerfFormattedData_BalancerStats_HyperVDynamicMemoryBalancer `\n-Namespace root\\cimv2\n\n# iterate through health stats\nforeach ($metric in $mem_runtime_stats)\n{\n $wildvalue = $metric.name -replace $regexA, '_'\n $memavailable = $metric.AvailableMemory \n $mempressure = $metric.AveragePressure \n write-host \"$wildvalue.AvailableMemory=$memavailable\"\n write-host \"$wildvalue.AveragePressure=$mempressure\"\n}\n\nGet-CimSession | Remove-CimSession\nEXIT 0"}, "datapoints": [{"name": "AvailableMemory", "description": "free memory available to the hypervisor (MB)", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.AvailableMemory", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "AveragePressure", "description": "ratio indicating how much memory requested by VMs to the amount of memory the hypervisor has allocated to these VMs; if this exceeds 100 VMs will begin paging, resulting in a performance degradation", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.AveragePressure", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 90 100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "The average memory pressure on Hyper-V host ##HOST## is now ##VALUE##%, which puts this device in a ##LEVEL## state. \n\nThis began at ##START## -- or ##DURATION## ago.\n\nOnce memory pressure has exceeded 100% VMs will begin paging and performance will degrade. Consider relocating some running VMs to another host."}], "graphs": [{"name": "Available Memory", "title": "Available Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AvailableMemory", "datapointName": "AvailableMemory", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "AvailableMemoryBytes", "expr": "AvailableMemory * 1024 * 1024"}], "lines": [{"type": "stack", "legend": "AvailableMemoryBytes", "color": "fuchsia", "datapointName": "AvailableMemoryBytes", "isVirtual": true}]}, {"name": "Memory Pressure", "title": "Memory Pressure", "verticalLabel": "%", "min": 0.0, "max": 120.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "AveragePressure", "datapointName": "AveragePressure", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Average Pressure", "color": "gray", "datapointName": "AveragePressure", "isVirtual": false}]}]}

×DataSource: Cisco_Meraki_Licenses (50)

{"name": "Cisco_Meraki_Licenses", "description": "Reports licensing status of a given organization in Meraki using the v1 API. This version supports per-device licensing.", "appliesTo": "hasCategory(\"MerakiAPIOrg\") && system.hostname != \"api.meraki.com\"", "technicalNotes": "Uses custom property \"meraki.api.key\" and auto properties from PropertySource \"addCategoryMerakiAPI\"\n\n- Support Page: https://www.logicmonitor.com/support/monitoring/networking-firewalls/meraki-cloud-wireless-access-controllers\n\n- This version uses the v1 API and gets one instance per activated license.", "displayedAs": "Meraki Licenses", "collectionInterval": "1h", "collectionMethod": "batchscript", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "1440m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.live.LiveHostSet\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\n\nmodLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n\nemit = modLoader.load(\"lm.emit\", \"0\")\nmeraki = modLoader.load(\"cisco.meraki\", \"0\")\n\ndef orgId = hostProps.get('meraki.org.id') ?: hostProps.get('auto.meraki.org.id')\ndef token = hostProps.get(\"meraki.api.key\")\n\nif (!token) {\n println \"API key missing; device property meraki.api.key must be set.\"\n return 1\n}\nif (!orgId) {\n println \"No org ID found; unable to retrieve org license state.\"\n return 1\n}\n\n\n// Silently report no instances since orgs that don't support this licnsing model just return a 400.\nList licenseState = []\ntry {\n licenseState = meraki.httpGet(token, \"/organizations/${orgId}/licenses\")\n}\ncatch (ProtocolException ignored) {\n return 0\n}\n\nlicenseState.each{ lic->\n if (lic.licenseKey == null) return\n String wildalias = \"${lic.licenseType}-${lic.licenseKey}\"\n String wildvalue = lic.id\n Map ilp = lic.collectEntries {[\"meraki.license.${it.key}\", it.value]}\n emit.instance(wildvalue, wildalias, ilp)\n}\n\n// Update the liveHost set so tell the collector we are happy.\nhostId = hostProps.get(\"system.deviceId\").toInteger()\nliveHostSet = LiveHostSet.getInstance()\nliveHostSet.flag(hostId)\n\n\nreturn 0\n"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.time.TimeCategory\nimport java.text.SimpleDateFormat\n\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.logicmonitor.mod.Snippets\n\nmodLoader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader()).withBinding(getBinding())\n\nemit = modLoader.load(\"lm.emit\", \"0\")\nmeraki = modLoader.load(\"cisco.meraki\", \"0\")\nbab = modLoader.load(\"lm.bitsandbobs\", \"0\")\n\nstateLookup = [\"recentlyQueued\":0, \"unused\":1, \"unusedActive\": 2, \"active\":3, \"expiring\":4, \"expired\":5]\n\ndef orgId = hostProps.get('meraki.org.id') ?: hostProps.get('auto.meraki.org.id')\ndef token = hostProps.get(\"meraki.api.key\")\n\nif (!token) {\n println \"API key missing; device property meraki.api.key must be set.\"\n return 1\n}\nif (!orgId) {\n println \"No org ID found; unable to retrieve org license state.\"\n return 1\n}\n\ndef licenseState = meraki.httpGet(token, \"/organizations/${orgId}/licenses\")\nlicenseState.each{ lic->\n if (lic.expirationDate) {\n expiryTime = TimeCategory.minus(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\").parse(lic.expirationDate), new Date())\n }\n \n emit.dp(lic.id, \"expiryDays\", expiryTime.getDays())\n emit.dp(lic.id, \"state\", stateLookup.getOrDefault(lic.state, -1))\n}\n\nbab.keepAlive(hostProps)\n\nreturn 0"}, "datapoints": [{"name": "expiryDays", "description": "Days until this license expires", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.expiryDays", "useValue": "output", "type": "gauge", "dataType": 7, "threshold": "<= 30 10 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "state", "description": "State of this license.\n0=recently Queued\n1=unused\n2=unused Active\n3=active\n5=expiring\n6=expired", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.state", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Days Left", "title": "Days Left", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "expiryDays", "datapointName": "expiryDays", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "expiryDays", "color": "silver", "datapointName": "expiryDays", "isVirtual": false}]}, {"name": "State", "title": "State", "verticalLabel": "state", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "state", "datapointName": "state", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "state", "color": "silver", "datapointName": "state", "isVirtual": false}]}]}

×DataSource: Cisco_vManage_Sessions (520)

{"name": "Cisco_vManage_Sessions", "description": "Manages vManage sessions in collector cache for use by other DataSources.", "appliesTo": "hasCategory(\"Cisco_vManage\")", "searchKeywords": "sdwan,vmanage,networking,cisco,viptela", "technicalNotes": "Requirements:\n - vmanage.user\n - vmanage.pass\n - vmanage.port", "displayedAs": "Cisco vManage: Sessions", "collectionInterval": "1m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\nBoolean debug = false\n// To save collector logs, set to true\nBoolean log = false\n\n// Collector version 30.000 or higher required for script cache and snippets\ncollectorCache = null\ndef modLoader\ntry {\n collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmvMan = modLoader.load(\"cisco.vmanage\", \"0\") // Load Cisco vManage module\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\n\n// Construct vManageSnippet class from snippet\nsnip = lmvMan.vManageSnippetFactory(out, collectorCache, hostProps, debug, log)\n\n// General debug info; prints property info when debug is set to true\nsnip.generalDebug()\n\nif (snip.checkCachedCreds()) {\n // Using cached creds so neither token updated\n lmEmit.dp(\"updatedSessionID\", 0)\n lmEmit.dp(\"updatedCSRFtoken\", 0)\n}\nelse {\n // Try logging out of the session we have cached\n snip.logout()\n snip.LMDebugPrint(\"Existing credentials failed. Logging in to retrieve a new session...\")\n // Update cache with new session\n snip.rewriteCachedSession()\n // Double check that what we have is now good\n if (snip.checkCachedCreds()) {\n\t\tlmEmit.dp(\"updatedSessionID\", 1)\n\t\t// Part of rewriting cached session includes updating CSRF token if this API version uses it\n\t\tif (snip.csrfToken) lmEmit.dp(\"updatedCSRFtoken\", 1)\n }\n else {\n println \"Credential check failed, even after reauthenticating. Try debug mode.\"\n snip.LMDebugLog(\"Credential check failed with reauthentication.\")\n return 1\n }\n}\n\nreturn 0"}, "datapoints": [{"name": "updatedCSRFtoken", "description": "Indictation of whether CSRF token in cache had to be updated.\n\n0=false, \n1=true", "interpretMethod": "namevalue", "interpretExpr": "updatedCSRFtoken", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "updatedSessionID", "description": "Indictation of whether session ID in cache had to be updated.\n\n0=false, \n1=true", "interpretMethod": "namevalue", "interpretExpr": "updatedSessionID", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Session Updates", "title": "Session Updates", "verticalLabel": "0=false, 1=true", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "updatedCSRFtoken", "datapointName": "updatedCSRFtoken", "consolidationFn": "max"}, {"name": "updatedSessionID", "datapointName": "updatedSessionID", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "CSRF token updated", "color": "olive", "datapointName": "updatedCSRFtoken", "isVirtual": false}, {"type": "line", "legend": "Session ID updated", "color": "navy", "datapointName": "updatedSessionID", "isVirtual": false}]}]}

×DataSource: DellEMC_PowerStore_ClusterCapacity (234)

{"name": "DellEMC_PowerStore_ClusterCapacity", "description": "Storage capacity metrics for PowerStore clusters.", "appliesTo": "hasCategory(\"DellEMC_PowerStore\")", "searchKeywords": "emc,powerstore,dell", "technicalNotes": "Required Host Properties: \n- dell.powerstore.user\n- dell.powerstore.pass\n- This DataSource makes HTTP requests querying the last 5 minutes so we advise keeping the collection interval at 5 minutes.", "displayedAs": "PowerStore Cluster Capacity", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\ndef debug = false\n\n// Collector version 30.000 or higher required for script snippets\ndef modLoader\ntry {\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\ndef lmPowerStore = modLoader.load(\"emc.powerstore\", \"0\") // Load PowerStore module\n\n// Construct snippet class\nsnip = lmPowerStore.powerStoreSnippetFactory(out, hostProps, debug)\n\ndef clusterEndpoint = \"/cluster\"\ndef clusterParams =\n\t\t[\"select\" : [\"global_id\", \"id\", \"name\", \"primary_appliance_id\", \"management_address\", \"storage_discovery_address\", \"state\", \"is_encryption_enabled\", \"physical_mtu\"],\n\t\t \"limit\" : 2000 ]\ndef clusterRequest = snip.httpGet(clusterEndpoint, clusterParams)\ndef clusterData = snip.slurpResponse(clusterRequest)\n\nclusterData.each{ cluster ->\n def globalId = cluster.global_id\n def clusterId = cluster.id\n\n\tdef ilps = [\n\t\t\"powerstore.cluster_name\" : cluster.name,\n\t\t\"powerstore.cluster_id\"\t\t\t\t: clusterId,\n\t\t\"powerstore.global_id\"\t\t\t\t: globalId,\n\t\t\"powerstore.pri_appliance_id\" : cluster.primary_appliance_id,\n\t\t\"powerstore.mgmt_address\" : cluster.management_address,\n\t\t\"powerstore.strg_discovery_address\" : cluster.storage_discovery_address,\n\t\t\"powerstore.state\" : cluster.state,\n\t\t\"powerstore.encryption_enabled\" : cluster.is_encryption_enabled,\n\t\t\"powerstore.physical_mtu\" : cluster.physical_mtu\n\t]\n\n\tlmEmit.instance(globalId, \"${cluster.name}-${clusterId}\",\n\t\t\t\t\t\"Cluster ID: ${clusterId}, Appliance ID: ${cluster.primary_appliance_id}\",\n\t\t\t\t\tilps)\n}\n\nreturn 0"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonOutput\n\n// To run in debug mode, set to true\ndef debug = false\n\n// Collector version 30.000 or higher required for script snippets\ndef modLoader\ntry {\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\ndef lmPowerStore = modLoader.load(\"emc.powerstore\", \"0\") // Load PowerStore module\n\n// Construct snippet class\nsnip = lmPowerStore.powerStoreSnippetFactory(out, hostProps, debug)\n\n// If we do not have a CSRF token stored, we need to login to a new session\nif (!snip.csrfToken) {\n\tsnip.logoutSession() // Logout for good measure, in case we have a dangling session with a different token\n\tsnip.LMDebugPrint(\"DELL-EMC-TOKEN not found in cookie store, opening new session to retrieve token\")\n\tsnip.openSession()\n}\n\n// List of metrics to report\nSet datapoints = [\n\t\"data_physical_used\",\n\t\"data_reduction\",\n\t\"efficiency_ratio\",\n\t\"logical_provisioned\",\n\t\"logical_used\",\n\t\"logical_used_file_system\",\n\t\"logical_used_volume\",\n\t\"logical_used_vvol\",\n\t\"physical_total\",\n\t\"physical_used\",\n\t\"shared_logical_used\",\n\t\"shared_logical_used_file_system\",\n\t\"shared_logical_used_volume\",\n\t\"shared_logical_used_vvol\",\n\t\"snapshot_savings\",\n\t\"thin_savings\"\n]\n\ndef wildvalue = instanceProps.get(\"wildvalue\")\ndef clusterId = instanceProps.get(\"auto.powerstore.cluster_id\")\n\ndef request = [\n\tentity : \"space_metrics_by_cluster\",\n\tentity_id : clusterId,\n\tinterval : \"Five_Mins\"\n]\n\nsnip.LMDebugPrint(\"Generating metrics for cluster ID ${clusterId}...\")\ndef metricsEndpoint = \"/metrics/generate\"\ndef metricResponse = snip.httpPost(metricsEndpoint, JsonOutput.toJson(request))\ndef metricResults = snip.slurpResponse(metricResponse)\n\nif (metricResults) {\n\tmetricResults.last().each{ metric, value ->\n\t\tif (datapoints.contains(metric)) {\n\t\t\tlmEmit.dp(wildvalue, metric, value)\n\t\t}\n\t}\n}\nelse {\n\tprintln \"No response received. Try debug mode.\"\n\treturn 1\n}\n\nreturn 0"}, "datapoints": [{"name": "dataPhysicalUsed", "description": "Total amount of physical space user data occupies after deduplication and compression.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.data_physical_used", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dataReduction", "description": "Ratio of the logical used space to data physical used space which is after deduplication and compression.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.data_reduction", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "efficiencyRatio", "description": "Overall efficiency is computed as a ratio of the total space provisioned to physical used space. For example, ten 2 GB volumes were provisioned and 1 GB of data is written to each of them. Each of the volumes has one snapshot as well, for another ten 2 GB volumes. All volumes are thinly provisioned with deduplication and compression applied, there is 4 GB of physical space used. Overall efficiency would be (20 * 2 GB) / 4 GB or 10:1. The efficiency_ratio value will be 10 in this example.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.efficiency_ratio", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "logicalProvisioned", "description": "Total configured size of all storage objects within the cluster. This metric includes all primaries, snaps and clones.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.logical_provisioned", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "logicalUsed", "description": "Amount of data in bytes written to all storage objects within the cluster, without any deduplication and/or compression. This metric includes all primaries, snaps and clones.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.logical_used", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "logicalUsedFs", "description": "Amount of data in bytes written to file systems within the cluster, without any deduplication and/or compression.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.logical_used_file_system", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "logicalUsedVol", "description": "Amount of data in bytes written to volumes within the cluster, without any deduplication and/or compression.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.logical_used_volume", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "logicalUsedVvol", "description": "Amount of data in bytes written to vvols within the cluster, without any deduplication and/or compression.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.logical_used_vvol", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "physicalTotal", "description": "Total combined space on the physical drives of the cluster available for data.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.physical_total", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "physicalUsed", "description": "Total physical space consumed in the cluster, accounting for all efficiency mechanisms, as well as all data protection.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.physical_used", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sharedLogicalUsed", "description": "Cluster shared logical used is sum of appliances' shared logical used in the cluster.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.shared_logical_used", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sharedLogicalUsedFs", "description": "Cluster shared logical used file system is sum of appliances' shared logical used in the cluster.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.shared_logical_used_file_system", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sharedLogicalUsedVol", "description": "Cluster shared logical used volume is sum of appliances' shared logical used in the cluster.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.shared_logical_used_volume", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "sharedLogicalUsedVvol", "description": "Cluster shared logical used vvol is sum of appliances' shared logical used in the cluster.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.shared_logical_used_vvol", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "snapshotSavings", "description": "Ratio of the amount of space that would have been used by snapshots if space efficiency was not applied to logical space used solely by snapshots. For example, an object is provisioned as 1 GB and it has two snapshots. Each snapshot has 200 MB of data. Snapshot savings will be (1 GB + 1 GB) / (0.2 GB + 0.2 GB) or 5:1. The snapshot_savings value will be 5 in this case.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.snapshot_savings", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "thinSavings", "description": "Ratio of all the vVol provisioned to data they contain. This is the ratio of logical_provisioned to logical_used. For example, a cluster has two 2 GB objects and have written 500 MB bytes of data to them. The thin savings would be (2 * 2 GB) / (2 * 0.5 GB) or 4:1, so the thin_savings value would be 4.0.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.thin_savings", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Logical Used by Type", "title": "Logical Used by Type", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "2hour", "scale1024": true, "rigid": false, "datapoints": [{"name": "logical_provisioned", "datapointName": "logicalProvisioned", "consolidationFn": "average"}, {"name": "logical_used", "datapointName": "logicalUsed", "consolidationFn": "average"}, {"name": "logical_used_file_system", "datapointName": "logicalUsedFs", "consolidationFn": "average"}, {"name": "logical_used_volume", "datapointName": "logicalUsedVol", "consolidationFn": "average"}, {"name": "logical_used_vvol", "datapointName": "logicalUsedVvol", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "logical_free", "expr": "logical_provisioned - logical_used"}], "lines": [{"type": "stack", "legend": "Free", "color": "lime", "datapointName": "logical_free", "isVirtual": true}, {"type": "line", "legend": "Provisioned", "color": "black", "datapointName": "logical_provisioned", "isVirtual": false}, {"type": "line", "legend": "Total used", "color": "red2", "datapointName": "logical_used", "isVirtual": false}, {"type": "stack", "legend": "Used file system", "color": "yellow", "datapointName": "logical_used_file_system", "isVirtual": false}, {"type": "stack", "legend": "Used volume", "color": "orange2", "datapointName": "logical_used_volume", "isVirtual": false}, {"type": "stack", "legend": "Used virtual volume", "color": "red", "datapointName": "logical_used_vvol", "isVirtual": false}]}, {"name": "Savings", "title": "Savings", "verticalLabel": "ratio", "min": 0.0, "displayPriority": 4, "timeScale": "2hour", "scale1024": false, "rigid": false, "datapoints": [{"name": "data_reduction", "datapointName": "dataReduction", "consolidationFn": "average"}, {"name": "efficiency_ratio", "datapointName": "efficiencyRatio", "consolidationFn": "average"}, {"name": "snapshot_savings", "datapointName": "snapshotSavings", "consolidationFn": "average"}, {"name": "thin_savings", "datapointName": "thinSavings", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Data reduction", "color": "fuchsia", "datapointName": "data_reduction", "isVirtual": false}, {"type": "line", "legend": "Efficiency ratio", "color": "yellow", "datapointName": "efficiency_ratio", "isVirtual": false}, {"type": "line", "legend": "Snapshot savings", "color": "olive", "datapointName": "snapshot_savings", "isVirtual": false}, {"type": "line", "legend": "Thin savings", "color": "blue", "datapointName": "thin_savings", "isVirtual": false}]}, {"name": "Shared Logical Usage by Type", "title": "Shared Logical Usage by Type", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "2hour", "scale1024": true, "rigid": false, "datapoints": [{"name": "shared_logical_used", "datapointName": "sharedLogicalUsed", "consolidationFn": "average"}, {"name": "shared_logical_used_file_system", "datapointName": "sharedLogicalUsedFs", "consolidationFn": "average"}, {"name": "shared_logical_used_volume", "datapointName": "sharedLogicalUsedVol", "consolidationFn": "average"}, {"name": "shared_logical_used_vvol", "datapointName": "sharedLogicalUsedVvol", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Total used", "color": "black", "datapointName": "shared_logical_used", "isVirtual": false}, {"type": "stack", "legend": "Used file system", "color": "yellow", "datapointName": "shared_logical_used_file_system", "isVirtual": false}, {"type": "stack", "legend": "Used volume", "color": "orange2", "datapointName": "shared_logical_used_volume", "isVirtual": false}, {"type": "stack", "legend": "Used virtual volume", "color": "red", "datapointName": "shared_logical_used_vvol", "isVirtual": false}]}, {"name": "Total Usage", "title": "Total Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "2hour", "scale1024": true, "rigid": false, "datapoints": [{"name": "dataPhysicalUsed", "datapointName": "dataPhysicalUsed", "consolidationFn": "average"}, {"name": "physical_total", "datapointName": "physicalTotal", "consolidationFn": "average"}, {"name": "physical_used", "datapointName": "physicalUsed", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "free", "expr": "physical_total - physical_used"}], "lines": [{"type": "line", "legend": "User data space used", "color": "yellow", "datapointName": "dataPhysicalUsed", "isVirtual": false}, {"type": "stack", "legend": "Free", "color": "green", "datapointName": "free", "isVirtual": true}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "physical_total", "isVirtual": false}, {"type": "stack", "legend": "Used", "color": "red", "datapointName": "physical_used", "isVirtual": false}]}]}

×DataSource: DellEMC_PowerStore_FibreChannelPort (232)

{"name": "DellEMC_PowerStore_FibreChannelPort", "description": "Frontend Fibre Channel port performance metrics for PowerStore.", "appliesTo": "hasCategory(\"DellEMC_PowerStore\")", "searchKeywords": "emc,powerstore,dell", "technicalNotes": "Required Host Properties: \n- dell.powerstore.user\n- dell.powerstore.pass\n- This DataSource makes HTTP requests querying the last 5 minutes so we advise keeping the collection interval at 5 minutes.", "displayedAs": "PowerStore Fibre Channel Port", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "60m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\n// To run in debug mode, set to true\ndef debug = false\n\n// Collector version 30.000 or higher required for script snippets\ndef modLoader\ntry {\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\ndef lmPowerStore = modLoader.load(\"emc.powerstore\", \"0\") // Load PowerStore module\n\n// Construct snippet class\nsnip = lmPowerStore.powerStoreSnippetFactory(out, hostProps, debug)\n\ndef fcEndpoint = \"/fc_port\"\ndef fcParams =\n\t\t[\"select\" : [\"name\", \"id\", \"current_speed\", \"wwn\", \"port_connector_type\", \"supported_speeds\", \"stale_state\"],\n\t\t \"limit\" : 2000 ]\ndef fcRequest = snip.httpGet(fcEndpoint, fcParams)\ndef fcData = snip.slurpResponse(fcRequest)\n\nfcData.each{ port ->\n def portId = port.id\n def name = port.name.split(\"-\")\n def node = (name[1].contains(\"Node\")) ? name[1] : \"\"\n def cleanName = \"${name[2]}-${name[3]} (${node})\"\n\n\tMap ilps = [\n\t\t\"powerstore.fcport.name\" : port.name,\n\t\t\"powerstore.fcport.node\" : node,\n\t\t\"powerstore.fcport.id\"\t\t\t\t : portId,\n\t\t\"powerstore.fcport.current_speed\" : port.current_speed.replace(\"_\", \" \"),\n\t\t\"powerstore.fcport.wwn\"\t\t\t : port.wwn,\n\t\t\"powerstore.fcport.connector_type\" : port.port_connector_type,\n\t\t\"powerstore.fcport.supported_speeds\" : port.supported_speeds.join(\",\").replace(\"_\", \" \"),\n\t\t\"powerstore.fcport.stale_state\" : port.stale_state,\n\t]\n\n def wildalias = (cleanName != \"-\") ? cleanName : port.name\n\n\tlmEmit.instance(portId, wildalias, ilps)\n}\n\nreturn 0"}, "groupMethod": "ilp", "groupExpr": "auto.powerstore.fcport.node"}, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport groovy.json.JsonOutput\n\n// To run in debug mode, set to true\ndef debug = false\n\n// Collector version 30.000 or higher required for script snippets\ndef modLoader\ntry {\n modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\n}\ncatch (ClassNotFoundException|MissingPropertyException ignored) {\n println \"Update collector to version 30.000 or higher for this DataSource.\"\n return 1\n}\n\ndef lmEmit = modLoader.load(\"lm.emit\", \"0\") // Load LM emit module\ndef lmPowerStore = modLoader.load(\"emc.powerstore\", \"0\") // Load PowerStore module\n\n// Construct snippet class\nsnip = lmPowerStore.powerStoreSnippetFactory(out, hostProps, debug)\n\n// If we do not have a CSRF token stored, we need to login to a new session\nif (!snip.csrfToken) {\n\tsnip.logoutSession() // Logout for good measure, in case we have a dangling session with a different token\n\tsnip.LMDebugPrint(\"DELL-EMC-TOKEN not found in cookie store, opening new session to retrieve token\")\n\tsnip.openSession()\n}\n\nSet exclude = [\n\t\"volume_id\",\n\t\"timestamp\",\n\t\"appliance_id\",\n\t\"repeat_count\",\n\t\"response_definition\",\n\t\"entity\",\n \"fe_port_id\",\n \"node_id\",\n \"avg_prim_seq_prot_err_count_ps\",\n \"max_prim_seq_prot_err_count_ps\"\n]\n\ndef wildvalue = instanceProps.get(\"wildvalue\")\n\ndef metricsEndpoint = \"/metrics/generate\"\n\ndef request = [\n\tentity : \"performance_metrics_by_fe_fc_port\",\n\tentity_id : wildvalue,\n\tinterval : \"Five_Mins\"\n]\ndef perfMetricResponse = snip.httpPost(metricsEndpoint, JsonOutput.toJson(request))\ndef perfMetricResults = snip.slurpResponse(perfMetricResponse)\n\nif (perfMetricResults) {\n\tperfMetricResults.last().each{ metric, value ->\n\t\tif (!exclude.contains(metric)) {\n\t\t\tlmEmit.dp(wildvalue, metric, value)\n\t\t}\n\t}\n}\nelse {\n\tprintln \"No performance metrics received. Try debug mode.\"\n\treturn 1\n}\n\nreturn 0"}, "datapoints": [{"name": "avgCurrentLogins", "description": "Average number of logins to the target from initiators.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_current_logins", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgDumpedFrames", "description": "Average dumped frames per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_dumped_frames_ps", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgIOSize", "description": "Average size of read and write operations in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_io_size", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgInvalidCRC", "description": "Average invalid CRC count per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_invalid_crc_count_ps", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgInvalidTxWord", "description": "Average invalid transmission word count per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_invalid_tx_word_count_ps", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgLatency", "description": "Average latency in microseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_latency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgLinkFailure", "description": "Average link failure count per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_link_failure_count_ps", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgReadBandwidth", "description": "Average read rate in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_read_bandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgReadBandwidthUnaligned", "description": "Average unaligned read rate in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_unaligned_read_bandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgReadIops", "description": "Average read operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_read_iops", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgReadIopsUnaligned", "description": "Average unaligned read operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_unaligned_read_iops", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgReadLatency", "description": "Average read latency in microseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_read_latency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgReadSize", "description": "Average read size in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_read_size", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgSignalLoss", "description": "Average loss of signal count per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_loss_of_signal_count_ps", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgSyncLoss", "description": "Average loss of sync count per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_loss_of_sync_count_ps", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgTotalBandwidth", "description": "Average total read and write rate in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_total_bandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgTotalBandwidthUnaligned", "description": "Average total unaligned read and write rate in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_unaligned_bandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgTotalIops", "description": "Average total read and write operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_total_iops", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgTotalIopsUnaligned", "description": "Average total unaligned read and write operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_unaligned_iops", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgWriteBandwidth", "description": "Average write rate in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_write_bandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgWriteBandwidthUnaligned", "description": "Average unaligned write rate in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_unaligned_write_bandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgWriteIops", "description": "Average write operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_write_iops", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgWriteIopsUnaligned", "description": "Average unaligned write operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_unaligned_write_iops", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgWriteLatency", "description": "Average write latency in microseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_write_latency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "avgWriteSize", "description": "Average write size in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.avg_write_size", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxCurrentLogins", "description": "Maximum number of logins to the target from initiators.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_current_logins", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxDumpedFrames", "description": "Maximum dumped frames per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_dumped_frames_ps", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxIOSize", "description": "Maximum average size of read and write operations in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_avg_io_size", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxInvalidCRC", "description": "Maximum invalid CRC count per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_invalid_crc_count_ps", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxInvalidTxWord", "description": "Maximum invalid transmission word count per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_invalid_tx_word_count_ps", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxLatency", "description": "Maximum average latency in microseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_avg_latency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxLinkFailure", "description": "Maximum link failure count per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_link_failure_count_ps", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxReadBandwidth", "description": "Maximum read rate in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_read_bandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxReadBandwidthUnaligned", "description": "Maximum unaligned read rate in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_unaligned_read_bandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxReadIops", "description": "Maximum read operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_read_iops", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxReadIopsUnaligned", "description": "Maximum unaligned read operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_unaligned_read_iops", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxReadLatency", "description": "Maximum average read latency in microseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_avg_read_latency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxReadSize", "description": "Maximum average read size in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_avg_read_size", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxSignalLoss", "description": "Maximum loss of signal count per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_loss_of_signal_count_ps", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxSyncLoss", "description": "Maximum loss of sync count per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_loss_of_sync_count_ps", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxTotalBandwidth", "description": "Maximum total read and write rate in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_total_bandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxTotalBandwidthUnaligned", "description": "Maximum total unaligned read and write rate in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_unaligned_bandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxTotalIops", "description": "Maximum total read and write operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_total_iops", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxTotalIopsUnaligned", "description": "Maximum total unaligned read and write operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_unaligned_iops", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxWriteBandwidth", "description": "Maximum write rate in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_write_bandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxWriteBandwidthUnaligned", "description": "Maximum unaligned write rate in bytes per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_unaligned_write_bandwidth", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxWriteIops", "description": "Maximum write operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_write_iops", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxWriteIopsUnaligned", "description": "Maximum unaligned write operations per second.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_unaligned_write_iops", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxWriteLatency", "description": "Maximum average write latency in microseconds.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_avg_write_latency", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "maxWriteSize", "description": "Maximum average write size in bytes.", "interpretMethod": "namevalue", "interpretExpr": "##WILDVALUE##.max_avg_write_size", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Average Failures & Errors", "title": "Average Failures & Errors", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 60, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "avgDumpedFrames", "datapointName": "avgDumpedFrames", "consolidationFn": "average"}, {"name": "avgInvalidCRC", "datapointName": "avgInvalidCRC", "consolidationFn": "average"}, {"name": "avgInvalidTxWord", "datapointName": "avgInvalidTxWord", "consolidationFn": "average"}, {"name": "avgLinkFailure", "datapointName": "avgLinkFailure", "consolidationFn": "average"}, {"name": "avgSignalLoss", "datapointName": "avgSignalLoss", "consolidationFn": "average"}, {"name": "avgSyncLoss", "datapointName": "avgSyncLoss", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Dumped frames", "color": "orange", "datapointName": "avgDumpedFrames", "isVirtual": false}, {"type": "stack", "legend": "Invalid CRC", "color": "yellow", "datapointName": "avgInvalidCRC", "isVirtual": false}, {"type": "stack", "legend": "Invalid transmission word", "color": "fuchsia", "datapointName": "avgInvalidTxWord", "isVirtual": false}, {"type": "stack", "legend": "Link failure", "color": "red2", "datapointName": "avgLinkFailure", "isVirtual": false}, {"type": "stack", "legend": "Signal loss", "color": "navy", "datapointName": "avgSignalLoss", "isVirtual": false}, {"type": "stack", "legend": "Sync loss", "color": "aqua", "datapointName": "avgSyncLoss", "isVirtual": false}]}, {"name": "Current Logins", "title": "Current Logins", "verticalLabel": "count", "min": 0.0, "displayPriority": 80, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "avgCurrentLogins", "datapointName": "avgCurrentLogins", "consolidationFn": "average"}, {"name": "maxCurrentLogins", "datapointName": "maxCurrentLogins", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "Average current logins", "color": "fuchsia", "datapointName": "avgCurrentLogins", "isVirtual": false}, {"type": "line", "legend": "Max current logins", "color": "black", "datapointName": "maxCurrentLogins", "isVirtual": false}]}, {"name": "Maximum Failures & Errors", "title": "Maximum Failures & Errors", "verticalLabel": "#/sec", "min": 0.0, "displayPriority": 63, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "maxDumpedFrames", "datapointName": "maxDumpedFrames", "consolidationFn": "max"}, {"name": "maxInvalidCRC", "datapointName": "maxInvalidCRC", "consolidationFn": "max"}, {"name": "maxInvalidTxWord", "datapointName": "maxInvalidTxWord", "consolidationFn": "max"}, {"name": "maxLinkFailure", "datapointName": "maxLinkFailure", "consolidationFn": "max"}, {"name": "maxSignalLoss", "datapointName": "maxSignalLoss", "consolidationFn": "max"}, {"name": "maxSyncLoss", "datapointName": "maxSyncLoss", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "Dumped frames", "color": "orange", "datapointName": "maxDumpedFrames", "isVirtual": false}, {"type": "stack", "legend": "Invalid CRC", "color": "yellow", "datapointName": "maxInvalidCRC", "isVirtual": false}, {"type": "stack", "legend": "Invalid transmission word", "color": "fuchsia", "datapointName": "maxInvalidTxWord", "isVirtual": false}, {"type": "stack", "legend": "Link failure", "color": "red2", "datapointName": "maxLinkFailure", "isVirtual": false}, {"type": "stack", "legend": "Signal loss", "color": "navy", "datapointName": "maxSignalLoss", "isVirtual": false}, {"type": "stack", "legend": "Sync loss", "color": "aqua", "datapointName": "maxSyncLoss", "isVirtual": false}]}, {"name": "Read Bandwidth", "title": "Read Bandwidth", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 30, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "avgReadBandwidth", "datapointName": "avgReadBandwidth", "consolidationFn": "average"}, {"name": "avgReadBandwidthUnaligned", "datapointName": "avgReadBandwidthUnaligned", "consolidationFn": "average"}, {"name": "maxReadBandwidth", "datapointName": "maxReadBandwidth", "consolidationFn": "max"}, {"name": "maxReadBandwidthUnaligned", "datapointName": "maxReadBandwidthUnaligned", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Average", "color": "olive", "datapointName": "avgReadBandwidth", "isVirtual": false}, {"type": "line", "legend": "Average unaligned", "color": "orange2", "datapointName": "avgReadBandwidthUnaligned", "isVirtual": false}, {"type": "line", "legend": "Max", "color": "green", "datapointName": "maxReadBandwidth", "isVirtual": false}, {"type": "line", "legend": "Max unaligned", "color": "red", "datapointName": "maxReadBandwidthUnaligned", "isVirtual": false}]}, {"name": "Read IOPS", "title": "Read IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "avgReadIops", "datapointName": "avgReadIops", "consolidationFn": "average"}, {"name": "avgReadIopsUnaligned", "datapointName": "avgReadIopsUnaligned", "consolidationFn": "average"}, {"name": "maxReadIops", "datapointName": "maxReadIops", "consolidationFn": "max"}, {"name": "maxReadIopsUnaligned", "datapointName": "maxReadIopsUnaligned", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Average", "color": "olive", "datapointName": "avgReadIops", "isVirtual": false}, {"type": "line", "legend": "Average unaligned", "color": "orange2", "datapointName": "avgReadIopsUnaligned", "isVirtual": false}, {"type": "line", "legend": "Max", "color": "green", "datapointName": "maxReadIops", "isVirtual": false}, {"type": "line", "legend": "Max unaligned", "color": "red", "datapointName": "maxReadIopsUnaligned", "isVirtual": false}]}, {"name": "Read Latency", "title": "Read Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "avgReadLatency", "datapointName": "avgReadLatency", "consolidationFn": "average"}, {"name": "maxReadLatency", "datapointName": "maxReadLatency", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "avgReadLatencyMs", "expr": "avgReadLatency / 1000"}, {"name": "maxReadLatencyMs", "expr": "maxReadLatency / 1000"}], "lines": [{"type": "line", "legend": "Average", "color": "olive", "datapointName": "avgReadLatencyMs", "isVirtual": true}, {"type": "line", "legend": "Max", "color": "green", "datapointName": "maxReadLatencyMs", "isVirtual": true}]}, {"name": "Read Size", "title": "Read Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "avgReadSize", "datapointName": "avgReadSize", "consolidationFn": "average"}, {"name": "maxReadSize", "datapointName": "maxReadSize", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "Average", "color": "olive", "datapointName": "avgReadSize", "isVirtual": false}, {"type": "line", "legend": "Max", "color": "green", "datapointName": "maxReadSize", "isVirtual": false}]}, {"name": "Total Bandwidth", "title": "Total Bandwidth", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 35, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "avgTotalBandwidth", "datapointName": "avgTotalBandwidth", "consolidationFn": "average"}, {"name": "avgTotalBandwidthUnaligned", "datapointName": "avgTotalBandwidthUnaligned", "consolidationFn": "average"}, {"name": "maxTotalBandwidth", "datapointName": "maxTotalBandwidth", "consolidationFn": "max"}, {"name": "maxTotalBandwidthUnaligned", "datapointName": "maxTotalBandwidthUnaligned", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Average", "color": "fuchsia", "datapointName": "avgTotalBandwidth", "isVirtual": false}, {"type": "line", "legend": "Average unaligned", "color": "orange2", "datapointName": "avgTotalBandwidthUnaligned", "isVirtual": false}, {"type": "line", "legend": "Max", "color": "red1", "datapointName": "maxTotalBandwidth", "isVirtual": false}, {"type": "line", "legend": "Max unaligned", "color": "red", "datapointName": "maxTotalBandwidthUnaligned", "isVirtual": false}]}, {"name": "Total IO Size", "title": "Total IO Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "avgIOSize", "datapointName": "avgIOSize", "consolidationFn": "average"}, {"name": "maxIOSize", "datapointName": "maxIOSize", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "Average", "color": "fuchsia", "datapointName": "avgIOSize", "isVirtual": false}, {"type": "line", "legend": "Max", "color": "red1", "datapointName": "maxIOSize", "isVirtual": false}]}, {"name": "Total IOPS", "title": "Total IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 15, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "avgTotalIops", "datapointName": "avgTotalIops", "consolidationFn": "average"}, {"name": "avgTotalIopsUnaligned", "datapointName": "avgTotalIopsUnaligned", "consolidationFn": "average"}, {"name": "maxTotalIops", "datapointName": "maxTotalIops", "consolidationFn": "max"}, {"name": "maxTotalIopsUnaligned", "datapointName": "maxTotalIopsUnaligned", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Average", "color": "fuchsia", "datapointName": "avgTotalIops", "isVirtual": false}, {"type": "line", "legend": "Average unaligned", "color": "orange2", "datapointName": "avgTotalIopsUnaligned", "isVirtual": false}, {"type": "line", "legend": "Max", "color": "red1", "datapointName": "maxTotalIops", "isVirtual": false}, {"type": "line", "legend": "Max unaligned", "color": "red", "datapointName": "maxTotalIopsUnaligned", "isVirtual": false}]}, {"name": "Total Latency", "title": "Total Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 45, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "avgLatency", "datapointName": "avgLatency", "consolidationFn": "average"}, {"name": "maxLatency", "datapointName": "maxLatency", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "avgLatencyMs", "expr": "avgLatency / 1000"}, {"name": "maxLatencyMs", "expr": "maxLatency / 1000"}], "lines": [{"type": "line", "legend": "Average", "color": "fuchsia", "datapointName": "avgLatencyMs", "isVirtual": true}, {"type": "line", "legend": "Max", "color": "red1", "datapointName": "maxLatencyMs", "isVirtual": true}]}, {"name": "Write Bandwidth", "title": "Write Bandwidth", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 33, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "avgWriteBandwidth", "datapointName": "avgWriteBandwidth", "consolidationFn": "average"}, {"name": "avgWriteBandwidthUnaligned", "datapointName": "avgWriteBandwidthUnaligned", "consolidationFn": "average"}, {"name": "maxWriteBandwidth", "datapointName": "maxWriteBandwidth", "consolidationFn": "max"}, {"name": "maxWriteBandwidthUnaligned", "datapointName": "maxWriteBandwidthUnaligned", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Average", "color": "aqua", "datapointName": "avgWriteBandwidth", "isVirtual": false}, {"type": "line", "legend": "Average unaligned", "color": "orange2", "datapointName": "avgWriteBandwidthUnaligned", "isVirtual": false}, {"type": "line", "legend": "Max", "color": "navy", "datapointName": "maxWriteBandwidth", "isVirtual": false}, {"type": "line", "legend": "Max unaligned", "color": "red", "datapointName": "maxWriteBandwidthUnaligned", "isVirtual": false}]}, {"name": "Write IOPS", "title": "Write IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 25, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "avgWriteIops", "datapointName": "avgWriteIops", "consolidationFn": "average"}, {"name": "avgWriteIopsUnaligned", "datapointName": "avgWriteIopsUnaligned", "consolidationFn": "average"}, {"name": "maxWriteIops", "datapointName": "maxWriteIops", "consolidationFn": "max"}, {"name": "maxWriteIopsUnaligned", "datapointName": "maxWriteIopsUnaligned", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Average", "color": "aqua", "datapointName": "avgWriteIops", "isVirtual": false}, {"type": "line", "legend": "Average unaligned", "color": "orange2", "datapointName": "avgWriteIopsUnaligned", "isVirtual": false}, {"type": "line", "legend": "Max", "color": "navy", "datapointName": "maxWriteIops", "isVirtual": false}, {"type": "line", "legend": "Max unaligned", "color": "red", "datapointName": "maxWriteIopsUnaligned", "isVirtual": false}]}, {"name": "Write Latency", "title": "Write Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 53, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "avgWriteLatency", "datapointName": "avgWriteLatency", "consolidationFn": "average"}, {"name": "maxWriteLatency", "datapointName": "maxWriteLatency", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "avgWriteLatencyMs", "expr": "avgWriteLatency / 1000"}, {"name": "maxWriteLatencyMs", "expr": "maxWriteLatency / 1000"}], "lines": [{"type": "line", "legend": "Average", "color": "aqua", "datapointName": "avgWriteLatencyMs", "isVirtual": true}, {"type": "line", "legend": "Max", "color": "navy", "datapointName": "maxWriteLatencyMs", "isVirtual": true}]}, {"name": "Write Size", "title": "Write Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "avgWriteSize", "datapointName": "avgWriteSize", "consolidationFn": "average"}, {"name": "maxWriteSize", "datapointName": "maxWriteSize", "consolidationFn": "max"}], "lines": [{"type": "stack", "legend": "Average", "color": "aqua", "datapointName": "avgWriteSize", "isVirtual": false}, {"type": "line", "legend": "Max", "color": "navy", "datapointName": "maxWriteSize", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 Ports by Read IOPS", "title": "Top 10 Ports by Read IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "avgReadIops", "datapointName": "avgReadIops", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "avgReadIops", "isVirtual": false}]}, {"name": "Top 10 Ports by Read Latency", "title": "Top 10 Ports by Read Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "avgReadLatency", "datapointName": "avgReadLatency", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "avgReadLatencyMs", "expr": "avgReadLatency / 1000"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "avgReadLatencyMs", "isVirtual": true}]}, {"name": "Top 10 Ports by Write IOPS", "title": "Top 10 Ports by Write IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "avgWriteIops", "datapointName": "avgWriteIops", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "avgWriteIops", "isVirtual": false}]}, {"name": "Top 10 Ports by Write Latency", "title": "Top 10 Ports by Write Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 15, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "avgWriteLatency", "datapointName": "avgWriteLatency", "consolidationFn": "average", "aggregateMethod": "sum"}], "virtualDatapoints": [{"name": "avgWriteLatencyMs", "expr": "avgWriteLatency / 1000"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "avgWriteLatencyMs", "isVirtual": true}]}]}

×DataSource: Kubernetes_KSM_Daemonsets (67)

{"name": "Kubernetes_KSM_Daemonsets", "description": "Monitors Kubernetes Daemonsets via KSM", "appliesTo": "hasCategory(\"KubernetesDaemonSet\") && hasCategory(\"KubernetesKSM\")", "searchKeywords": "kube-state-metrics,kubernetes,ksm,k8s,daemonset,daemon", "displayedAs": "Kubernetes Daemonsets", "collectionInterval": "1m", "collectionMethod": "openmetrics", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"url": "##auto.ksm.service.url##", "connectTimeoutMs": 2000, "readTimeoutMs": 10000, "followRedirect": false}, "datapoints": [{"name": "age", "description": "DaemonSet age in seconds.", "config": {}, "interpretMethod": "expression", "interpretExpr": "now()-kubeDaemonsetCreated", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ageDays", "description": "Daemonset age in days.", "config": {}, "interpretMethod": "expression", "interpretExpr": "age/86400", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "expectedReadyReplicas", "description": "The expected number of nodes that should have Replicas in ready state. (No. of Desired Replicas - No. of Ready Replicas)", "config": {}, "interpretMethod": "expression", "interpretExpr": "kubeDaemonsetStatusDesiredNumberScheduled-kubeDaemonsetStatusNumberReady", "type": "gauge", "dataType": 7, "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 5, "alertSubject": "Expecting Replicas in Ready state", "alertBody": "The DaemonSet on ##HOST## is expecting ##VALUE## nodes that should have the daemonset running placing it in a ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "expectedUpdatedReplicas", "description": "The expected number of nodes that should have an updated version of Replicas. (No. of Desired Replicas - No. of Updated Replicas)", "config": {}, "interpretMethod": "expression", "interpretExpr": "kubeDaemonsetStatusDesiredNumberScheduled-kubeDaemonsetStatusUpdatedNumberScheduled", "type": "gauge", "dataType": 7, "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 5, "alertSubject": "Expected updated daemonset replicas", "alertBody": "The DaemonSet on ##HOST## is expecting ##VALUE## nodes that should have an updated version of daemonset running, placing it in a ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "kubeDaemonsetCreated", "description": "Unix creation timestamp of when the DaemonSet was created.", "config": {"metricName": "kube_daemonset_created", "instanceLabel": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeDaemonsetStatusCurrentNumberScheduled", "description": "The number of nodes running at least one daemon pod and are supposed to.", "config": {"metricName": "kube_daemonset_status_current_number_scheduled", "instanceLabel": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeDaemonsetStatusDesiredNumberScheduled", "description": "The number of nodes that should be running the daemon pod.", "config": {"metricName": "kube_daemonset_status_desired_number_scheduled", "instanceLabel": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeDaemonsetStatusNumberAvailable", "description": "The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and available.", "config": {"metricName": "kube_daemonset_status_number_available", "instanceLabel": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeDaemonsetStatusNumberMisscheduled", "description": "The number of nodes running a daemon pod but are not supposed to.", "config": {"metricName": "kube_daemonset_status_number_misscheduled", "instanceLabel": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 5, "alertBody": "There are ##VALUE## misscheduled daemon pods running on ##HOST## placing it in a ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "kubeDaemonsetStatusNumberReady", "description": "The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and ready.", "config": {"metricName": "kube_daemonset_status_number_ready", "instanceLabel": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeDaemonsetStatusNumberUnavailable", "description": "The number of nodes that should be running the daemon pod and have none of the daemon pod running and available.", "config": {"metricName": "kube_daemonset_status_number_unavailable", "instanceLabel": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeDaemonsetStatusUpdatedNumberScheduled", "description": "The total number of nodes that are running the updated daemon pod.", "config": {"metricName": "kube_daemonset_status_updated_number_scheduled", "instanceLabel": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",daemonset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Age", "title": "Age", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ageDays", "datapointName": "ageDays", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Age", "color": "silver", "datapointName": "ageDays", "isVirtual": false}]}, {"name": "Schedule Status", "title": "Schedule Status", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeDaemonsetStatusCurrentNumberScheduled", "datapointName": "kubeDaemonsetStatusCurrentNumberScheduled", "consolidationFn": "max"}, {"name": "kubeDaemonsetStatusDesiredNumberScheduled", "datapointName": "kubeDaemonsetStatusDesiredNumberScheduled", "consolidationFn": "max"}, {"name": "kubeDaemonsetStatusUpdatedNumberScheduled", "datapointName": "kubeDaemonsetStatusUpdatedNumberScheduled", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "Scheduled", "color": "lime", "datapointName": "kubeDaemonsetStatusCurrentNumberScheduled", "isVirtual": false}, {"type": "line", "legend": "Desired", "color": "silver", "datapointName": "kubeDaemonsetStatusCurrentNumberScheduled", "isVirtual": false}, {"type": "line", "legend": "Updated", "color": "fuchsia", "datapointName": "kubeDaemonsetStatusUpdatedNumberScheduled", "isVirtual": false}]}, {"name": "Status", "title": "Status", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeDaemonsetStatusNumberAvailable", "datapointName": "kubeDaemonsetStatusNumberAvailable", "consolidationFn": "max"}, {"name": "kubeDaemonsetStatusNumberMisscheduled", "datapointName": "kubeDaemonsetStatusNumberMisscheduled", "consolidationFn": "max"}, {"name": "kubeDaemonsetStatusNumberReady", "datapointName": "kubeDaemonsetStatusNumberReady", "consolidationFn": "max"}, {"name": "kubeDaemonsetStatusNumberUnavailable", "datapointName": "kubeDaemonsetStatusNumberUnavailable", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Available", "color": "silver", "datapointName": "kubeDaemonsetStatusNumberAvailable", "isVirtual": false}, {"type": "line", "legend": "Misscheduled", "color": "red2", "datapointName": "kubeDaemonsetStatusNumberMisscheduled", "isVirtual": false}, {"type": "line", "legend": "Ready", "color": "olive", "datapointName": "kubeDaemonsetStatusNumberReady", "isVirtual": false}, {"type": "line", "legend": "Unavailable", "color": "orange", "datapointName": "kubeDaemonsetStatusNumberUnavailable", "isVirtual": false}]}]}

×DataSource: Kubernetes_KSM_PersistentVolumes (114)

{"name": "Kubernetes_KSM_PersistentVolumes", "description": "Monitors Kubernetes PersistentVolumes via KSM", "appliesTo": "hasCategory(\"KubernetesPersistentVolume\") && hasCategory(\"KubernetesKSM\")", "searchKeywords": "volume,kube-state-metrics,kubernetes,ksm,k8s,persistentvolumes", "displayedAs": "Kubernetes Persistent Volumes", "collectionInterval": "1m", "collectionMethod": "openmetrics", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"url": "##auto.ksm.service.url##", "connectTimeoutMs": 2000, "readTimeoutMs": 10000, "followRedirect": false}, "datapoints": [{"name": "kubePersistentvolumeCapacityBytes", "description": "Persistentvolume capacity in bytes.", "config": {"metricName": "kube_persistentvolume_capacity_bytes", "instanceLabel": "persistentvolume=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "persistentvolume=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePersistentvolumeCapacityGb", "description": "Capacity of PersistentVolume in Gbs.", "config": {}, "interpretMethod": "expression", "interpretExpr": "((kubePersistentvolumeCapacityBytes/1024)/1024)/1024", "type": "gauge", "dataType": 7, "min": "0", "threshold": "<= 0 0 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 5, "alertBody": "The persistent volume ##auto.name## on ##HOST## is reporting that it has ##VALUE## GB capacity, placing the host in a ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "kubePersistentvolumeStatusPhase", "description": "Status code that returns phase of the PersistentVolume.\n\nStatus Codes:\n0=Bound\n1=Available\n2=Failed\n3=Released\n4=Pending", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(gt(kubePersistentvolumeStatusPhaseBound,0),0,(if(gt(kubePersistentvolumeStatusPhaseAvailable,0),1,(if(gt(kubePersistentvolumeStatusPhaseFailed,0),2,(if(gt(kubePersistentvolumeStatusPhaseReleased,0),3,(if(gt(kubePersistentvolumeStatusPhasePending,0),4,5)))))))))", "type": "gauge", "dataType": 7, "min": "0", "max": "5", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePersistentvolumeStatusPhaseAvailable", "description": "Status code indicating if the volume is available.\n\nStatus Codes:\n0=unavailable\n1=available", "config": {"metricName": "kube_persistentvolume_status_phase", "instanceLabel": "persistentvolume=\"##auto.name##\",phase=\"Available\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "persistentvolume=\"##auto.name##\",phase=\"Available\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePersistentvolumeStatusPhaseBound", "description": "Status code indicating if the volume is bound.\n\nStatus Codes:\n0=unbound\n1=bound", "config": {"metricName": "kube_persistentvolume_status_phase", "instanceLabel": "persistentvolume=\"##auto.name##\",phase=\"Bound\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "persistentvolume=\"##auto.name##\",phase=\"Bound\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePersistentvolumeStatusPhaseFailed", "description": "Status code indicating if the volume is failed.\n\nStatus Codes:\n0=not failed\n1=failed", "config": {"metricName": "kube_persistentvolume_status_phase", "instanceLabel": "persistentvolume=\"##auto.name##\",phase=\"Failed\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "persistentvolume=\"##auto.name##\",phase=\"Failed\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePersistentvolumeStatusPhasePending", "description": "Status code indicating if the volume is pending.\n\nStatus Codes:\n0=not pending\n1=pending", "config": {"metricName": "kube_persistentvolume_status_phase", "instanceLabel": "persistentvolume=\"##auto.name##\",phase=\"Pending\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "persistentvolume=\"##auto.name##\",phase=\"Pending\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePersistentvolumeStatusPhaseReleased", "description": "Status code indicating if the volume is released.\n\nStatus Codes:\n0=unreleased\n1=released", "config": {"metricName": "kube_persistentvolume_status_phase", "instanceLabel": "persistentvolume=\"##auto.name##\",phase=\"Released\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "persistentvolume=\"##auto.name##\",phase=\"Released\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Capacity", "title": "Capacity", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "kubePersistentvolumeCapacityBytes", "datapointName": "kubePersistentvolumeCapacityBytes", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Capacity", "color": "silver", "datapointName": "kubePersistentvolumeCapacityBytes", "isVirtual": false}]}, {"name": "Status Phase", "title": "Status Phase", "verticalLabel": "status code", "min": -1.0, "max": 5.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubePersistentvolumeStatusPhase", "datapointName": "kubePersistentvolumeStatusPhase", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Phase", "color": "silver", "datapointName": "kubePersistentvolumeStatusPhase", "isVirtual": false}]}]}

×DataSource: Kubernetes_KSM_Replicasets (113)

{"name": "Kubernetes_KSM_Replicasets", "description": "Monitors Kubernetes Replicasets via KSM", "appliesTo": "hasCategory(\"KubernetesReplicaset\") && hasCategory(\"KubernetesKSM\")", "searchKeywords": "kube-state-metrics,kubernetes,ksm,replica,k8s,replicaset", "displayedAs": "Kubernetes Replicasets", "collectionInterval": "1m", "collectionMethod": "openmetrics", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"url": "##auto.ksm.service.url##", "connectTimeoutMs": 2000, "readTimeoutMs": 10000, "followRedirect": false}, "datapoints": [{"name": "age", "description": "ReplicaSet Age in seconds.", "config": {}, "interpretMethod": "expression", "interpretExpr": "now()-kubeReplicasetCreated", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ageDays", "description": "ReplicaSet age in days.", "config": {}, "interpretMethod": "expression", "interpretExpr": "age/86400", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "expectedReadyReplicas", "description": "The expected number of Ready Replicas. (No. of Desired Replicas - No. of Ready Replicas)", "config": {}, "interpretMethod": "expression", "interpretExpr": "kubeReplicasetSpecReplicas-kubeReplicasetStatusReadyReplicas", "type": "gauge", "dataType": 7, "min": "-1", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 5, "alertBody": "##HOST## is expected to have ##VALUE## more replicas in Ready State. Hence raised ##LEVEL## alert.\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "kubeReplicasetCreated", "description": "Unix creation timestamp of the ReplicaSet.", "config": {"metricName": "kube_replicaset_created", "instanceLabel": "namespace=\"##auto.namespace##\",replicaset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",replicaset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeReplicasetSpecReplicas", "description": "Number of desired pods for a ReplicaSet.", "config": {"metricName": "kube_replicaset_spec_replicas", "instanceLabel": "namespace=\"##auto.namespace##\",replicaset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",replicaset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeReplicasetStatusFullyLabeledReplicas", "description": "The number of fully labeled replicas per ReplicaSet.", "config": {"metricName": "kube_replicaset_status_fully_labeled_replicas", "instanceLabel": "namespace=\"##auto.namespace##\",replicaset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",replicaset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeReplicasetStatusReadyReplicas", "description": "The number of ready replicas per ReplicaSet.", "config": {"metricName": "kube_replicaset_status_ready_replicas", "instanceLabel": "namespace=\"##auto.namespace##\",replicaset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",replicaset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 5}, {"name": "kubeReplicasetStatusReplicas", "description": "The number of replicas per ReplicaSet.", "config": {"metricName": "kube_replicaset_status_replicas", "instanceLabel": "namespace=\"##auto.namespace##\",replicaset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",replicaset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Age", "title": "Age", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ageDays", "datapointName": "ageDays", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Age", "color": "silver", "datapointName": "ageDays", "isVirtual": false}]}, {"name": "Expected Replicas", "title": "Expected Replicas", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "expectedReadyReplicas", "datapointName": "expectedReadyReplicas", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "expectedReadyReplicas", "color": "orange", "datapointName": "expectedReadyReplicas", "isVirtual": false}]}, {"name": "Replicas", "title": "Replicas", "verticalLabel": "count", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeReplicasetSpecReplicas", "datapointName": "kubeReplicasetSpecReplicas", "consolidationFn": "max"}, {"name": "kubeReplicasetStatusFullyLabeledReplicas", "datapointName": "kubeReplicasetStatusFullyLabeledReplicas", "consolidationFn": "max"}, {"name": "kubeReplicasetStatusReadyReplicas", "datapointName": "kubeReplicasetStatusReadyReplicas", "consolidationFn": "max"}, {"name": "kubeReplicasetStatusReplicas", "datapointName": "kubeReplicasetStatusReplicas", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Expected", "color": "yellow", "datapointName": "kubeReplicasetSpecReplicas", "isVirtual": false}, {"type": "line", "legend": "Fully Labeled", "color": "fuchsia", "datapointName": "kubeReplicasetStatusFullyLabeledReplicas", "isVirtual": false}, {"type": "line", "legend": "Ready", "color": "lime", "datapointName": "kubeReplicasetStatusReadyReplicas", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "silver", "datapointName": "kubeReplicasetStatusReplicas", "isVirtual": false}]}]}

×DataSource: Kubernetes_KSM_Statefulsets (112)

{"name": "Kubernetes_KSM_Statefulsets", "description": "Monitors Kubernetes Statefulsets via KSM", "appliesTo": "hasCategory(\"KubernetesStatefulset\") && hasCategory(\"KubernetesKSM\")", "searchKeywords": "kube-state-metrics,kubernetes,ksm,k8s,stateful sets", "displayedAs": "Kubernetes Statefulsets", "collectionInterval": "1m", "collectionMethod": "openmetrics", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"url": "##auto.ksm.service.url##", "connectTimeoutMs": 2000, "readTimeoutMs": 10000, "followRedirect": false}, "datapoints": [{"name": "age", "description": "Statefulset Age in seconds.", "config": {}, "interpretMethod": "expression", "interpretExpr": "(now()-kubeStatefulsetCreated)", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ageDays", "description": "Statefulset age in days.", "config": {}, "interpretMethod": "expression", "interpretExpr": "age/86400", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "expectedReadyReplicas", "description": "The expected number of Ready Replicas. (No. of Desired Replicas - No. of Ready Replicas)", "config": {}, "interpretMethod": "expression", "interpretExpr": "kubeStatefulsetStatusReplicas-kubeStatefulsetStatusReplicasReady", "type": "gauge", "dataType": 7, "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 5, "alertSubject": "Expecting Replicas in Ready state", "alertBody": "##HOST## is expected to have ##VALUE## more replicas in Ready State. Hence raised ##LEVEL## alert.\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "generationMismatch", "description": "StatefulSet generation mismatch (Statefulset Observed Generation - Statefulset Metadata Generation)", "config": {}, "interpretMethod": "expression", "interpretExpr": "kubeStatefulsetStatusObservedGeneration-kubeStatefulsetMetadataGeneration", "type": "gauge", "dataType": 7, "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 5, "alertSubject": "StatefulSet generation mismatch", "alertBody": "##HOST## is expected to have ##VALUE## more replicas of Updated Generation. Hence raised ##LEVEL## alert.\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "kubeStatefulsetCreated", "description": "Timestamp when the StatefulSet was created.", "config": {"metricName": "kube_statefulset_created", "instanceLabel": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeStatefulsetMetadataGeneration", "description": "Sequence number representing a specific generation of the desired state for the StatefulSet.", "config": {"metricName": "kube_statefulset_metadata_generation", "instanceLabel": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeStatefulsetReplicas", "description": "Number of desired pods for a StatefulSet.", "config": {"metricName": "kube_statefulset_replicas", "instanceLabel": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeStatefulsetStatusObservedGeneration", "description": "The generation observed by the StatefulSet controller.", "config": {"metricName": "kube_statefulset_status_observed_generation", "instanceLabel": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeStatefulsetStatusReplicas", "description": "The number of replicas per StatefulSet.", "config": {"metricName": "kube_statefulset_status_replicas", "instanceLabel": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeStatefulsetStatusReplicasAvailable", "description": "The number of available replicas per StatefulSet.", "config": {"metricName": "kube_statefulset_status_replicas_available", "instanceLabel": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeStatefulsetStatusReplicasCurrent", "description": "The number of current replicas per StatefulSet.", "config": {"metricName": "kube_statefulset_status_replicas_current", "instanceLabel": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeStatefulsetStatusReplicasReady", "description": "The number of ready replicas per StatefulSet.", "config": {"metricName": "kube_statefulset_status_replicas_ready", "instanceLabel": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeStatefulsetStatusReplicasUpdated", "description": "The number of updated replicas per StatefulSet.", "config": {"metricName": "kube_statefulset_status_replicas_updated", "instanceLabel": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",statefulset=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Age", "title": "Age", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ageDays", "datapointName": "ageDays", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Age", "color": "silver", "datapointName": "ageDays", "isVirtual": false}]}, {"name": "Statefulset Generation", "title": "Statefulset Generation", "verticalLabel": "value", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeStatefulsetMetadataGeneration", "datapointName": "kubeStatefulsetMetadataGeneration", "consolidationFn": "average"}, {"name": "kubeStatefulsetStatusObservedGeneration", "datapointName": "kubeStatefulsetStatusObservedGeneration", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Metadata Generation", "color": "aqua", "datapointName": "kubeStatefulsetMetadataGeneration", "isVirtual": false}, {"type": "line", "legend": "Observed Generation", "color": "lime", "datapointName": "kubeStatefulsetStatusObservedGeneration", "isVirtual": false}]}, {"name": "Status", "title": "Status", "verticalLabel": "count", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeStatefulsetReplicas", "datapointName": "kubeStatefulsetReplicas", "consolidationFn": "max"}, {"name": "kubeStatefulsetStatusReplicas", "datapointName": "kubeStatefulsetStatusReplicas", "consolidationFn": "max"}, {"name": "kubeStatefulsetStatusReplicasAvailable", "datapointName": "kubeStatefulsetStatusReplicasAvailable", "consolidationFn": "max"}, {"name": "kubeStatefulsetStatusReplicasCurrent", "datapointName": "kubeStatefulsetStatusReplicasCurrent", "consolidationFn": "max"}, {"name": "kubeStatefulsetStatusReplicasReady", "datapointName": "kubeStatefulsetStatusReplicasReady", "consolidationFn": "max"}, {"name": "kubeStatefulsetStatusReplicasUpdated", "datapointName": "kubeStatefulsetStatusReplicasUpdated", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Expected", "color": "yellow", "datapointName": "kubeStatefulsetReplicas", "isVirtual": false}, {"type": "line", "legend": "Total", "color": "silver", "datapointName": "kubeStatefulsetStatusReplicas", "isVirtual": false}, {"type": "line", "legend": "Available", "color": "aqua", "datapointName": "kubeStatefulsetStatusReplicasAvailable", "isVirtual": false}, {"type": "line", "legend": "Current", "color": "fuchsia", "datapointName": "kubeStatefulsetStatusReplicasCurrent", "isVirtual": false}, {"type": "line", "legend": "Ready", "color": "olive", "datapointName": "kubeStatefulsetStatusReplicasReady", "isVirtual": false}]}]}

×DataSource: VMware_ESXi_HostPerformance (1123)

{"name": "VMware_ESXi_HostPerformance", "description": "Monitors health and performance metrics of the ESX host.", "appliesTo": "system.virtualization == \"VMWare ESX host\"", "searchKeywords": "application,vsphere,virtualization,vmware,esx", "technicalNotes": "- define esx.user and esx.pass for authentication", "displayedAs": "VMware Host Performance", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "import com.santaba.agent.groovyapi.esx.ESX;\nimport com.vmware.vim25.*;\nimport com.vmware.vim25.mo.*;\n\ndef host = hostProps.get(\"system.hostname\");\ndef user = hostProps.get(\"esx.user\");\ndef pass = hostProps.get(\"esx.pass\");\ndef addr = hostProps.get(\"esx.url\") ?: \"https://${host}/sdk\";\n\ndef pollInterval = 5 * 60;\n\ndef ag = [\"NOP\" : 1, // Use value of rollup instance.\n\t\t \"SUM\" : 2, // Sum all instances.\n\t\t \"AVG\" : 3] // Average all instances.\n\ndef perfCounters = [\"mem.vmmemctl.average\"\t\t\t: [ag.NOP],\n\t\t\t\t\t\"cpu.usage.average\"\t\t\t\t: [ag.NOP],\n\t\t\t\t\t\"cpu.utilization.average\"\t\t: [ag.NOP],\n\t\t\t\t\t\"mem.active.average\"\t\t\t: [ag.NOP],\n\t\t\t\t\t\"mem.consumed.average\"\t\t\t: [ag.NOP],\n\t\t\t\t\t\"mem.shared.average\"\t\t\t: [ag.NOP],\n\t\t\t\t\t\"mem.sharedcommon.average\"\t\t: [ag.NOP],\n\t\t\t\t\t\"mem.usage.average\"\t\t\t\t: [ag.NOP],\n\t\t\t\t\t\"mem.state.latest\"\t\t\t\t: [ag.NOP],\n\t\t\t\t\t\"mem.swapin.average\"\t\t\t: [ag.NOP],\n\t\t\t\t\t\"mem.swapout.average\"\t\t\t: [ag.NOP],\n\t\t\t\t\t\"mem.swapused.average\"\t\t\t: [ag.NOP],\n\t\t\t\t\t\"sys.uptime.latest\"\t\t\t\t: [ag.NOP],\n\t\t\t\t\t\"disk.read.average\"\t\t\t\t: [ag.NOP],\n\t\t\t\t\t\"disk.write.average\"\t\t\t: [ag.NOP],\n\t\t\t\t\t\"disk.totalReadLatency.average\"\t: [ag.AVG],\n\t\t\t\t\t\"disk.totalWriteLatency.average\": [ag.AVG],\n\t\t\t\t\t\"disk.numberWrite.summation\"\t: [ag.SUM],\n\t\t\t\t\t\"disk.numberRead.summation\"\t\t: [ag.SUM],\n\t\t\t\t\t\"net.droppedRx.summation\" \t\t: [ag.SUM],\n\t\t\t\t\t\"net.droppedTx.summation\" \t\t: [ag.SUM],\n\t\t\t\t\t\"net.packetsRx.summation\" \t\t: [ag.SUM],\n\t\t\t\t\t\"net.packetsTx.summation\" \t\t: [ag.SUM],\n\t\t\t\t\t\"net.received.average\"\t\t\t: [ag.NOP, ag.SUM],\n\t\t\t\t\t\"net.transmitted.average\"\t\t: [ag.NOP, ag.SUM]];\n\n// Connect up to the esx service\ndef svc = new ESX();\nsvc.open(addr, user, pass, 10 * 1000); // timeout in 10 seconds\n\ndef counterIds = svc.getCounterToIdMap();\ndef counterMap = perfCounters.collectEntries { [(counterIds[it.key]): it] };\n\ndef si = svc.getServiceInstance();\ndef rootFolder = si.getRootFolder();\ndef performanceManager = si.getPerformanceManager();\n\ndef end = si.currentTime(); // Timestamp we are collecting for\ndef start = end.clone();\nstart.add(Calendar.SECOND, -pollInterval);\n\n// Get all of the host systems (it's going to be 1 on ESX hosts)\ndef esx = new InventoryNavigator(rootFolder).searchManagedEntities(\"HostSystem\").first();\n\n// Collect all of the subscribed counters on all of the instances\ndef metrics = [];\n\ncounterMap.each\n{\n\tk, v->\n\n\tdef id = new PerfMetricId();\n\tid.setCounterId(k);\n\tid.setInstance(\"*\");\n\tmetrics.add(id);\n}\n\ndef spec = new PerfQuerySpec();\nspec.setStartTime(start);\nspec.setEndTime(end);\nspec.setMaxSample(1);\nspec.setMetricId(metrics as PerfMetricId[]);\nspec.setEntity(esx.getMOR());\n\ndef scalingFactor = pollInterval / 20; // Divide our poll interval by the underlying sample interval used for aggregations.\n\ndef res = performanceManager.queryPerf([spec] as PerfQuerySpec[]); // Get the data\n\n// Go through every result in the response.\nfor(result in res)\n{\n\tdef instanceGroupedResutls = result.value.groupBy{it.id.counterId};\n\n\tinstanceGroupedResutls.each\n\t{\n\t\tid, values->\n\n\t\tdef counterInfo = counterMap[id];\n\t\tdef wildvalue = counterInfo.key.replace(\".\", \"_\");\n\n\t\tdef scaler = wildvalue.endsWith(\"summation\") ? scalingFactor : 1;\n\n\t\tif(counterInfo.value.contains(ag.NOP))\n\t\t{\n\t\t\t// Unpack the counters\n\t\t\tprintln \"${wildvalue}=${values.findAll{!it.id.instance}.value*.sum().first() / scaler}\";\t\t\n\t\t}\n\t\t\n\t\tif(counterInfo.value.contains(ag.AVG) || counterInfo.value.contains(ag.SUM))\n\t\t{\n\t\t\tdef valueList = values.findAll{it.id.instance}.value*.sum();\n\n\t\t\tif(counterInfo.value.contains(ag.AVG))\n\t\t\t{\t\n\t\t\t\tprintln \"${wildvalue}/avg=${(valueList.sum() / scaler) / valueList.size()}\";\n\t\t\t}\n\n\t\t\tif(counterInfo.value.contains(ag.SUM))\n\t\t\t{\n\t\t\t\tprintln \"${wildvalue}/sum=${(valueList.sum() / scaler)}\";\n\t\t\t}\n\t\t}\n\t}\n}\n\nreturn 0;"}, "datapoints": [{"name": "Balloon", "description": "The sum of all vmmemctl values for all powered-on virtual machines, plus vSphere services on the host.", "interpretMethod": "namevalue", "interpretExpr": "mem_vmmemctl_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CPUUsage", "description": "CPU usage as a hundreths of a percent.", "interpretMethod": "namevalue", "interpretExpr": "cpu_usage_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CPUUsagePercent", "description": "Converts the raw CpuUsage datapoint to percent", "interpretMethod": "expression", "interpretExpr": "CPUUsage/100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 3, "alertBody": "ESX host ##HOST## is experiencing high sustained CPU usage of ##VALUE##%, placing the host into ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "CPUUtilization", "description": "CPU utilization as a hundreths of a percent (CPUUsage and CPUUtilization might be different due to power management technologies or hyper-threading).", "interpretMethod": "namevalue", "interpretExpr": "cpu_utilization_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CPUUtilizationPercent", "description": "Converts the raw CPUUtilization value to a percent.", "interpretMethod": "expression", "interpretExpr": "CPUUtilization/100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataRateRx", "description": "The rate at which data is received across each physical NIC instance on the host (KBytes per second).", "interpretMethod": "namevalue", "interpretExpr": "net_received_average/sum", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DataRateTx", "description": "The rate at which data is transmitted across each physical NIC instance on the host (KBytes per second).", "interpretMethod": "namevalue", "interpretExpr": "net_transmitted_average/sum", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskReadKBytesPerSec", "description": "Average number of kilobytes read from disk each second during the collection interval.\nRate at which data is read from each LUN on the host (KBytes per second)", "interpretMethod": "namevalue", "interpretExpr": "disk_read_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskReadLatency", "description": "Average amount of time taken during the collection interval to process a SCSI read command issued by the Guest OS to the virtual machine. The sum of kernelWriteLatency and deviceWriteLatency. (ms)", "interpretMethod": "namevalue", "interpretExpr": "disk_totalReadLatency_average/avg", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "ESX host ##HOST## is experience high read latency of ##VALUE## milliseconds, placing the host into ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "DiskReads", "description": "Number of times data was read from each LUN on the host during the collection interval.", "interpretMethod": "namevalue", "interpretExpr": "disk_numberRead_summation/sum", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskWriteKbytesPerSec", "description": "Average number of kilobytes written to disk each second during the collection interval.\nRate at which data is written to each LUN on the host (KBytes per second)", "interpretMethod": "namevalue", "interpretExpr": "disk_write_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "DiskWriteLatency", "description": "Average amount of time taken during the collection interval to process a SCSI write command issued by the Guest OS to the virtual machine. The sum of kernelWriteLatency and deviceWriteLatency. (ms)", "interpretMethod": "namevalue", "interpretExpr": "disk_totalWriteLatency_average/avg", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "ESX host ##HOST## is experience high write latency of ##VALUE## milliseconds, placing the host into ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "DiskWrites", "description": "Number of times data was written to each LUN on the host during the collection interval.", "interpretMethod": "namevalue", "interpretExpr": "disk_numberWrite_summation/sum", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IsStandaloneServer", "description": "Standalone flag used to condition alerts on standalone ESXi servers", "interpretMethod": "groovy", "interpretExpr": "hostProps.get(\"system.categories\").find(\"StandaloneESXi\")?1:0\n", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemState", "description": "VMkernel memory state, based on free memory, that affects page reclamation. \n\nStatus Codes:\n0 - high state: Break Large Pages when below Threshold\n1 - clear: Break Large Pages and actively call TPS to collapse pages\n2 - soft: TPS + Balloon \n3 - hard state: TPS + Compress + Swap\n4 - low: Compress + Swap + Block", "interpretMethod": "namevalue", "interpretExpr": "mem_state_latest", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "ESX host ##HOST## is reporting a memory state of ##VALUE##, placing it into ##LEVEL## state.\n\nStatus Codes:\n0 - high state: Break Large Pages when below Threshold\n1 - clear: Break Large Pages and actively call TPS to collapse pages\n2 - soft: TPS + Balloon \n3 - hard state: TPS + Compress + Swap\n4 - low: Compress + Swap + Block\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "MemoryActive", "description": "Sum of all active metrics (amount of memory that is actively used, as estimated by VMkernel based on recently touched memory pages) for all powered-on virtual machines plus vSphere services (such as COS, vpxa) on the host.", "interpretMethod": "namevalue", "interpretExpr": "mem_active_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemoryConsumed", "description": "Amount of machine memory (KBytes) used on the host. Consumed memory includes Includes memory used by the Service Console, the VMkernel, vSphere services, plus the total consumed metrics for all running virtual machines.\n\nhost consumed memory = total host memory - free host memory", "interpretMethod": "namevalue", "interpretExpr": "mem_consumed_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemoryShared", "description": "Sum of all shared memory (KBytes) for all powered-on virtual machines, plus amount for vSphere services on the host. The host's shared memory may be larger than the amount of machine memory if memory is overcommitted. The value of this statistic reflects how effective transparent page sharing and memory overcommitment are for saving machine memory.", "interpretMethod": "namevalue", "interpretExpr": "mem_shared_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemorySharedCommon", "description": "Amount of machine memory used to provide the MemoryShared spaces.", "interpretMethod": "namevalue", "interpretExpr": "mem_sharedcommon_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemoryUsagePercent", "description": "Percent of memory in use", "interpretMethod": "expression", "interpretExpr": "MemoryUsagePercentRaw/100", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 3, "alertBody": "ESX host ##HOST## is experiencing high sustained memory usage of ##VALUE##%, placing the host into ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "MemoryUsagePercentRaw", "description": "Memory usage as percentage of available machine memory (%). Raw value is * 100.", "interpretMethod": "namevalue", "interpretExpr": "mem_usage_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsDroppedRx", "description": "Number of receive packets dropped during the collection interval.", "interpretMethod": "namevalue", "interpretExpr": "net_droppedRx_summation/sum", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "ESX host ##HOST## is dropping ##VALUE## inbound packets per second, placing it into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "PacketsDroppedTx", "description": "Number of transmit packets dropped during the collection interval.", "interpretMethod": "namevalue", "interpretExpr": "net_droppedTx_summation/sum", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "ESX host ##HOST## is dropping ##VALUE## outbound packets per second, placing it into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "PacketsRx", "description": "Total number of packets received on all virtual machines running on the host.", "interpretMethod": "namevalue", "interpretExpr": "net_packetsRx_summation/sum", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PacketsTx", "description": "Number of packets transmitted across each physical NIC instance on the host.", "interpretMethod": "namevalue", "interpretExpr": "net_packetsTx_summation/sum", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Standalone_CPUUsagePercent", "description": "Converts the raw CpuUsage datapoint to percent", "interpretMethod": "expression", "interpretExpr": "if(IsStandaloneServer, CPUUsagePercent, unkn)", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": ">= 75 95", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 3, "alertBody": "ESX host ##HOST## is experiencing high sustained CPU usage of ##VALUE##%, placing the host into ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "Standalone_DiskReadLatency", "description": "Average amount of time taken during the collection interval to process a SCSI read command issued by the Guest OS to the virtual machine. The sum of kernelWriteLatency and deviceWriteLatency. (ms)", "interpretMethod": "expression", "interpretExpr": "if(IsStandaloneServer, DiskReadLatency, unkn)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": ">= 15 30", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 3, "alertBody": "ESX host ##HOST## is experience high read latency of ##VALUE## milliseconds, placing the host into ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "Standalone_DiskWriteLatency", "description": "Average amount of time taken during the collection interval to process a SCSI write command issued by the Guest OS to the virtual machine. The sum of kernelWriteLatency and deviceWriteLatency. (ms)", "interpretMethod": "expression", "interpretExpr": "if(IsStandaloneServer, DiskWriteLatency, unkn)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": ">= 15 30", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 3, "alertBody": "ESX host ##HOST## is experience high write latency of ##VALUE## milliseconds, placing the host into ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "Standalone_MemState", "description": "VMkernel memory state, based on free memory, that affects page reclamation. \n\nStatus Codes:\n0 - high state: Break Large Pages when below Threshold\n1 - clear: Break Large Pages and actively call TPS to collapse pages\n2 - soft: TPS + Balloon \n3 - hard state: TPS + Compress + Swap\n4 - low: Compress + Swap + Block", "interpretMethod": "expression", "interpretExpr": "if(IsStandaloneServer, MemState, unkn)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 1 2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "ESX host ##HOST## is reporting a memory state of ##VALUE##, placing it into ##LEVEL## state.\n\nStatus Codes:\n0 - high state: Break Large Pages when below Threshold\n1 - clear: Break Large Pages and actively call TPS to collapse pages\n2 - soft: TPS + Balloon \n3 - hard state: TPS + Compress + Swap\n4 - low: Compress + Swap + Block\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "Standalone_MemoryUsagePercent", "description": "Percent of memory in use", "interpretMethod": "expression", "interpretExpr": "if(IsStandaloneServer, MemoryUsagePercent, unkn)", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": ">= 90 95", "noData": "Do not trigger an alert", "triggerInterval": 3, "clearInterval": 3, "alertBody": "ESX host ##HOST## is experiencing high sustained memory usage of ##VALUE##%, placing the host into ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "Standalone_PacketsDroppedRx", "description": "Number of receive packets dropped during the collection interval.", "interpretMethod": "expression", "interpretExpr": "if(IsStandaloneServer, PacketsDroppedRx, unkn)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": ">= 1", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "ESX host ##HOST## is dropping ##VALUE## inbound packets per second, placing it into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "Standalone_PacketsDroppedTx", "description": "Number of transmit packets dropped during the collection interval.", "interpretMethod": "expression", "interpretExpr": "if(IsStandaloneServer, PacketsDroppedTx, unkn)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": ">= 1", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "ESX host ##HOST## is dropping ##VALUE## outbound packets per second, placing it into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "Standalone_SwapIn", "description": "Sum of swapin values for all powered-on virtual machines on the host", "interpretMethod": "expression", "interpretExpr": "if(IsStandaloneServer, SwapIn, unkn)", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "threshold": "> 150", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "ESX host ##HOST## is swapping virtual machine memory in at the rate of ##VALUE## kilobytes per second, placing it into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "Standalone_SwapOut", "description": "Sum of swapout metrics from all powered-on virtual machines on the host.", "interpretMethod": "expression", "interpretExpr": "if(IsStandaloneServer, SwapOut, unkn)", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "threshold": "> 150", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "ESX host ##HOST## is swapping virtual machine memory out at the rate of ##VALUE## kilobytes per second, placing it into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "Standalone_Uptime", "description": "Total time elapsed, in seconds, since last system startup.", "interpretMethod": "expression", "interpretExpr": "if(IsStandaloneServer, Uptime, unkn)", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "< 3600", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "ESX host ##HOST## has only been up for ##VALUE## seconds .\n\nIf the host was restarted as part of planned maintenance, you may disregard the alert. Otherwise, please investigate why the host went down.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "SwapIn", "description": "Sum of swapin values for all powered-on virtual machines on the host", "interpretMethod": "namevalue", "interpretExpr": "mem_swapin_average", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "ESX host ##HOST## is swapping virtual machine memory in at the rate of ##VALUE## kilobytes per second, placing it into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "SwapOut", "description": "Sum of swapout metrics from all powered-on virtual machines on the host.", "interpretMethod": "namevalue", "interpretExpr": "mem_swapout_average", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "ESX host ##HOST## is swapping virtual machine memory out at the rate of ##VALUE## kilobytes per second, placing it into ##LEVEL## state.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "SwapUsed", "description": "Sum of memory swapped of all powered on VMs and vSphere services on the host.", "interpretMethod": "namevalue", "interpretExpr": "mem_swapused_average", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TotalMem", "description": "TotalMemory on the host in KBytes", "interpretMethod": "expression", "interpretExpr": "MemoryConsumed*100/MemoryUsagePercent", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "Uptime", "description": "Total time elapsed, in seconds, since last system startup.", "interpretMethod": "namevalue", "interpretExpr": "sys_uptime_latest", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertBody": "ESX host ##HOST## has only been up for ##VALUE## seconds .\n\nIf the host was restarted as part of planned maintenance, you may disregard the alert. Otherwise, please investigate why the host went down.\n\nThis started at ##START##, -- or ##DURATION## ago."}], "graphs": [{"name": "CPU Usage", "title": "CPU Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CpuUsagePercent", "datapointName": "CPUUsagePercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "CPU Usage %", "color": "silver", "datapointName": "CpuUsagePercent", "isVirtual": false}]}, {"name": "CPU Utilization", "title": "CPU Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "CpuUtilizationPercent", "datapointName": "CPUUtilizationPercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "CPU Utilization %", "color": "orange2", "datapointName": "CpuUtilizationPercent", "isVirtual": false}]}, {"name": "Disk IOPS", "title": "Disk IOPS", "verticalLabel": "IOPS", "min": 0.0, "displayPriority": 6, "timeScale": "1hour", "scale1024": false, "rigid": true, "datapoints": [{"name": "DiskReads", "datapointName": "DiskReads", "consolidationFn": "average"}, {"name": "DiskWrites", "datapointName": "DiskWrites", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Read", "color": "olive", "datapointName": "DiskReads", "isVirtual": false}, {"type": "stack", "legend": "Write", "color": "teal", "datapointName": "DiskWrites", "isVirtual": false}]}, {"name": "Disk Latency", "title": "Disk Latency", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 4, "timeScale": "1hour", "scale1024": false, "rigid": true, "datapoints": [{"name": "DiskReadLatency", "datapointName": "DiskReadLatency", "consolidationFn": "average"}, {"name": "DiskWriteLatency", "datapointName": "DiskWriteLatency", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Read", "color": "yellow", "datapointName": "DiskReadLatency", "isVirtual": false}, {"type": "line", "legend": "Write", "color": "red", "datapointName": "DiskWriteLatency", "isVirtual": false}]}, {"name": "Disk Throughput", "title": "Disk Throughput", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": true, "rigid": true, "datapoints": [{"name": "DiskReadKBytesPerSec", "datapointName": "DiskReadKBytesPerSec", "consolidationFn": "average"}, {"name": "DiskWriteKbytesPerSec", "datapointName": "DiskWriteKbytesPerSec", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Read", "expr": "DiskReadKBytesPerSec*1024"}, {"name": "Write", "expr": "DiskWriteKBytesPerSec*1024"}], "lines": [{"type": "stack", "legend": "Read", "color": "aqua", "datapointName": "Read", "isVirtual": true}, {"type": "stack", "legend": "Write", "color": "lime", "datapointName": "Write", "isVirtual": true}]}, {"name": "Memory", "title": "Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": true, "datapoints": [{"name": "Balloon", "datapointName": "Balloon", "consolidationFn": "average"}, {"name": "MemoryActive", "datapointName": "MemoryActive", "consolidationFn": "average"}, {"name": "MemoryConsumed", "datapointName": "MemoryConsumed", "consolidationFn": "average"}, {"name": "SwapUsed", "datapointName": "SwapUsed", "consolidationFn": "average"}, {"name": "TotalMem", "datapointName": "TotalMem", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Ballooned", "expr": "Balloon*1024"}, {"name": "Swapped", "expr": "SwapUsed*1024"}, {"name": "TotalMemBytes", "expr": "TotalMem*1024"}, {"name": "Active", "expr": "MemoryActive*1024"}, {"name": "Consumed", "expr": "MemoryConsumed*1024"}], "lines": [{"type": "line", "legend": "Active", "color": "silver", "datapointName": "Active", "isVirtual": true}, {"type": "line", "legend": "Ballooned", "color": "orange2", "datapointName": "Ballooned", "isVirtual": true}, {"type": "area", "legend": "Consumed", "color": "aqua", "datapointName": "Consumed", "isVirtual": true}, {"type": "line", "legend": "Swapped", "color": "red", "datapointName": "Swapped", "isVirtual": true}, {"type": "line", "legend": "Total", "color": "black", "datapointName": "TotalMemBytes", "isVirtual": true}]}, {"name": "Memory Shared", "title": "Memory Shared", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 12, "timeScale": "1day", "scale1024": true, "rigid": true, "datapoints": [{"name": "MemoryShared", "datapointName": "MemoryShared", "consolidationFn": "average"}, {"name": "MemorySharedCommon", "datapointName": "MemorySharedCommon", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Shared", "expr": "MemoryShared*1024"}, {"name": "Common", "expr": "MemorySharedCommon*1024"}], "lines": [{"type": "line", "legend": "Common among multiple VMs", "color": "black", "datapointName": "Common", "isVirtual": true}, {"type": "area", "legend": "Memory Saved by sharing", "color": "yellow", "datapointName": "Shared", "isVirtual": true}]}, {"name": "Memory Status", "title": "Memory Status", "verticalLabel": "status code", "min": -1.0, "max": 6.0, "displayPriority": 11, "timeScale": "1hour", "scale1024": false, "rigid": true, "datapoints": [{"name": "MemState", "datapointName": "MemState", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "State", "color": "blue", "datapointName": "MemState", "isVirtual": false}]}, {"name": "Memory Usage Percent", "title": "Memory Usage Percent", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": true, "datapoints": [{"name": "MemoryUsagePercent", "datapointName": "MemoryUsagePercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Memory Used", "color": "maroon", "datapointName": "MemoryUsagePercent", "isVirtual": false}]}, {"name": "Network Packet Transmission", "title": "Network Packet Transmission", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 9, "timeScale": "1hour", "scale1024": false, "rigid": false, "datapoints": [{"name": "PacketsRx", "datapointName": "PacketsRx", "consolidationFn": "average"}, {"name": "PacketsTx", "datapointName": "PacketsTx", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "blue", "datapointName": "PacketsRx", "isVirtual": false}, {"type": "stack", "legend": "Transmitted", "color": "green", "datapointName": "PacketsTx", "isVirtual": false}]}, {"name": "Network Packets Dropped", "title": "Network Packets Dropped", "verticalLabel": "packets/sec", "min": 0.0, "displayPriority": 14, "timeScale": "1hour", "scale1024": false, "rigid": false, "datapoints": [{"name": "PacketsDroppedRx", "datapointName": "PacketsDroppedRx", "consolidationFn": "average"}, {"name": "PacketsDroppedTx", "datapointName": "PacketsDroppedTx", "consolidationFn": "average"}], "lines": [{"type": "stack", "legend": "Received", "color": "purple", "datapointName": "PacketsDroppedRx", "isVirtual": false}, {"type": "stack", "legend": "Transmit", "color": "red2", "datapointName": "PacketsDroppedTx", "isVirtual": false}]}, {"name": "Network Throughput", "title": "Network Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 10, "timeScale": "1hour", "scale1024": false, "rigid": false, "datapoints": [{"name": "DataRateRx", "datapointName": "DataRateRx", "consolidationFn": "average"}, {"name": "DataRateTx", "datapointName": "DataRateTx", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Receive", "expr": "8*DataRateRx*1024"}, {"name": "Transmit", "expr": "8*DataRateTx*1024"}], "lines": [{"type": "stack", "legend": "Received", "color": "blue", "datapointName": "Receive", "isVirtual": true}, {"type": "stack", "legend": "Transmitted", "color": "green", "datapointName": "Transmit", "isVirtual": true}]}, {"name": "Swap Rate", "title": "Memory Swap Rate", "verticalLabel": "bytes/sec", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": true, "rigid": true, "datapoints": [{"name": "SwapIn", "datapointName": "SwapIn", "consolidationFn": "average"}, {"name": "SwapOut", "datapointName": "SwapOut", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "InBytes", "expr": "SwapIn*1024"}, {"name": "OutBytes", "expr": "SwapOut*1024"}], "lines": [{"type": "line", "legend": "Swap In", "color": "fuchsia", "datapointName": "InBytes", "isVirtual": true}, {"type": "line", "legend": "Swap Out", "color": "red", "datapointName": "OutBytes", "isVirtual": true}]}, {"name": "Uptime", "title": "Uptime", "verticalLabel": "days", "min": 0.0, "displayPriority": 13, "timeScale": "1month", "scale1024": false, "rigid": true, "datapoints": [{"name": "Uptime", "datapointName": "Uptime", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "Days", "expr": "Uptime/86400"}], "lines": [{"type": "line", "legend": "Host Uptime (days)", "color": "gray", "datapointName": "Days", "isVirtual": true}]}]}

×DataSource: Microsoft_Azure_PostgreSQLFlexible (259)

{"name": "Microsoft_Azure_PostgreSQLFlexible", "description": "Monitors the Azure PostgreSQL Flexible Database performance metrics.", "appliesTo": "hasCategory(\"Azure/PostgreSQLFlexible\")", "searchKeywords": "cloud,database,postgres,azure", "displayedAs": "Azure PostgreSQLFlexible", "collectionInterval": "1m", "collectionMethod": "azureinsights", "multiInstance": false, "dataSourceType": 1, "datapoints": [{"name": "ActiveConnections", "description": "Total number of active connections to the database.", "interpretMethod": "json", "interpretExpr": "active_connections.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BackupStorageUsed", "description": "Amount of backup storage used (bytes). This metric represents the sum of storage consumed by all the full database backups, differential backups, and log backups retained based on the backup retention period set for the server. The frequency of the backups is service managed. For geo-redundant storage, backup storage usage is twice that of the locally redundant storage.", "interpretMethod": "json", "interpretExpr": "backup_storage_used.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CPUCreditsConsumed", "description": "Number of credits used by the flexible server (count). Applicable to Burstable tier.", "interpretMethod": "json", "interpretExpr": "cpu_credits_consumed.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CPUCreditsRemaining", "description": "Number of credits available to burst (count). Applicable to Burstable tier.", "interpretMethod": "json", "interpretExpr": "cpu_credits_remaining.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "CPUPercent", "description": "Percent CPU usage.", "interpretMethod": "json", "interpretExpr": "cpu_percent.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ConnectionsFailed", "description": "Number of failed connections/sec to the database.", "interpretMethod": "json", "interpretExpr": "connections_failed.##primaryaggregation##", "useValue": "rawData", "type": "derive", "dataType": 7, "min": "0", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Azure PostgreSQL host ##HOST## is reporting ##VALUE## failed connections/sec, placing the host into ##LEVEL## state.\n\nIf your connections are failing with an error message 'ERROR 1040 (08004): Too many connections' , you have reached your service tier limit for database connections. Consider upgrading to a higher tier or limit the number of database connections. \n\nFurther service limit details can be found here : https://docs.microsoft.com/en-us/azure/postgresql/concepts-limits\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "DiskQueueDepth", "description": "Number of outstanding I/O operations to the data disk (count).", "interpretMethod": "json", "interpretExpr": "disk_queue_depth.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "IOPS", "description": "Number of I/O operations to disk per second.", "interpretMethod": "json", "interpretExpr": "iops.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MaximumUsedTransactionIDs", "description": "Maximum transaction ID in use.", "interpretMethod": "json", "interpretExpr": "maximum_used_transactionIDs.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemoryPercent", "description": "Percentage of available memory used.", "interpretMethod": "json", "interpretExpr": "memory_percent.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NetworkIn", "description": "Amount of incoming network traffic (bytes).", "interpretMethod": "json", "interpretExpr": "network_bytes_ingress.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "NetworkOut", "description": "Amount of outgoing network traffic (bytes).", "interpretMethod": "json", "interpretExpr": "network_bytes_egress.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ReadIOPS", "description": "Number of data disk I/O read operations per second.", "interpretMethod": "json", "interpretExpr": "read_iops.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ReadThroughput", "description": "Bytes read per second from disk (bytes).", "interpretMethod": "json", "interpretExpr": "read_throughput.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "StorageFree", "description": "The amount of storage space available (bytes).", "interpretMethod": "json", "interpretExpr": "storage_free.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "StoragePercent", "description": "Percentage of available storage utilized.", "interpretMethod": "json", "interpretExpr": "storage_percent.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 90", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "Azure PostgreSQL host ##HOST## has reported ##VALUE## % of available storage is now utilized, placing the host into ##LEVEL## state.\n\nIf you are consistently receiving alerts regarding high storage utilization, consider increasing maximum storage capacity by upgrading to a higher service tier or adjust the alert threshold.\n\nThis started at ##START##, -- or ##DURATION## ago."}, {"name": "StorageUsed", "description": "Amount of available memory used, in bytes.", "interpretMethod": "json", "interpretExpr": "storage_used.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "SucceededConnections", "description": "Succeeded connections (count).", "interpretMethod": "json", "interpretExpr": "connections_succeeded.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WriteIOPS", "description": "Number of data disk I/O write operations per second.", "interpretMethod": "json", "interpretExpr": "write_iops.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WriteThroughput", "description": "Bytes written per second to disk (bytes).", "interpretMethod": "json", "interpretExpr": "write_throughput.##primaryaggregation##", "useValue": "rawData", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Active Connections", "title": "Active Connections", "verticalLabel": "#", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ActiveConnections", "datapointName": "ActiveConnections", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Active Connections", "color": "aqua", "datapointName": "ActiveConnections", "isVirtual": false}]}, {"name": "Backup Storage Used", "title": "Backup Storage Used", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 8, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "BackupStorageUsed", "datapointName": "BackupStorageUsed", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "BackupStorageUsed", "color": "blue", "datapointName": "BackupStorageUsed", "isVirtual": false}]}, {"name": "CPU Credits", "title": "CPU Credits", "verticalLabel": "#", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "Consumed", "datapointName": "CPUCreditsConsumed", "consolidationFn": "average"}, {"name": "Remaining", "datapointName": "CPUCreditsRemaining", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Consumed", "color": "blue", "datapointName": "Consumed", "isVirtual": false}, {"type": "line", "legend": "Remaining", "color": "blue", "datapointName": "Remaining", "isVirtual": false}]}, {"name": "CPU Usage", "title": "CPU Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CPUPercent", "datapointName": "CPUPercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "CPU Usage", "color": "orange2", "datapointName": "CPUPercent", "isVirtual": false}]}, {"name": "Disk Queue Depth", "title": "Disk Queue Depth", "verticalLabel": "#", "min": 0.0, "displayPriority": 12, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "DiskQueueDepth", "datapointName": "DiskQueueDepth", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "DiskQueueDepth", "color": "silver", "datapointName": "DiskQueueDepth", "isVirtual": false}]}, {"name": "Disk Throughput", "title": "Disk Throughput", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "ReadThroughput", "datapointName": "ReadThroughput", "consolidationFn": "average"}, {"name": "WriteThroughput", "datapointName": "WriteThroughput", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "ReadThroughput", "color": "silver", "datapointName": "ReadThroughput", "isVirtual": false}, {"type": "line", "legend": "WriteThroughput", "color": "silver", "datapointName": "WriteThroughput", "isVirtual": false}]}, {"name": "Failed Connections", "title": "Failed Connections", "verticalLabel": "connections/sec", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ConnectionsFailed", "datapointName": "ConnectionsFailed", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Failed", "color": "red", "datapointName": "ConnectionsFailed", "isVirtual": false}]}, {"name": "IOPS", "title": "IOPS", "verticalLabel": "#", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "IOPS", "datapointName": "IOPS", "consolidationFn": "average"}, {"name": "ReadIOPS", "datapointName": "ReadIOPS", "consolidationFn": "average"}, {"name": "WriteIOPS", "datapointName": "WriteIOPS", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "IOPS", "color": "navy", "datapointName": "IOPS", "isVirtual": false}, {"type": "line", "legend": "ReadIOPS", "color": "aqua", "datapointName": "ReadIOPS", "isVirtual": false}, {"type": "line", "legend": "WriteIOPS", "color": "teal", "datapointName": "WriteIOPS", "isVirtual": false}]}, {"name": "Maximum Used Transaction IDs", "title": "Maximum Used Transaction IDs", "verticalLabel": "#", "min": 0.0, "displayPriority": 13, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "MaximumUsedTransactionIDs", "datapointName": "MaximumUsedTransactionIDs", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "MaximumUsedTransactionIDs", "color": "silver", "datapointName": "MaximumUsedTransactionIDs", "isVirtual": false}]}, {"name": "Memory Utilization", "title": "Memory Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "MemoryPercent", "datapointName": "MemoryPercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilized", "color": "fuchsia", "datapointName": "MemoryPercent", "isVirtual": false}]}, {"name": "Network In/Out", "title": "Network In/Out", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 10, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "NetworkIn", "datapointName": "NetworkIn", "consolidationFn": "average"}, {"name": "NetworkOut", "datapointName": "NetworkOut", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "NetworkIn", "color": "olive", "datapointName": "NetworkIn", "isVirtual": false}, {"type": "line", "legend": "NetworkOut", "color": "orange", "datapointName": "NetworkOut", "isVirtual": false}]}, {"name": "Storage Details", "title": "Storage Details", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "StorageUsed", "datapointName": "StorageUsed", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Used", "color": "orange", "datapointName": "StorageUsed", "isVirtual": false}]}, {"name": "Storage Free", "title": "Storage Free", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 14, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "StorageFree", "datapointName": "StorageFree", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "StorageFree", "color": "silver", "datapointName": "StorageFree", "isVirtual": false}]}, {"name": "Storage Utilization", "title": "Storage Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "StoragePercent", "datapointName": "StoragePercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Utilized", "color": "orange2", "datapointName": "StoragePercent", "isVirtual": false}]}, {"name": "Succeeded Connections", "title": "Succeeded Connections", "verticalLabel": "#", "min": 0.0, "displayPriority": 15, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "SucceededConnections", "datapointName": "SucceededConnections", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "SucceededConnections", "color": "silver", "datapointName": "SucceededConnections", "isVirtual": false}]}]}

×DataSource: LogicMonitor_Collector_Snippets (229)

{"name": "LogicMonitor_Collector_Snippets", "description": "Metrics and Monitoring for LM's Code Snippets", "appliesTo": "hasCategory(\"collector\")", "group": "Collector", "technicalNotes": "As part of testing, also grabs the latest version of the loader via the API using an approach supporting proxy servers. Can be used to resolve loader issues on older collectors.", "displayedAs": "Snippets", "collectionInterval": "5m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH\nimport com.santaba.agent.util.script.ScriptCache\nimport com.logicmonitor.mod.Snippets\n\n// Check if we can grab the latest loader version from API (if not in today's cache)\ntry {\n\tget(\"loader\", \"1.9.1\", \"groovy\")\n\tprintln \"LaterThanEmbed=1\"\n} catch ( ex ) {\n\tprintln \"LaterThanEmbed=0\"\n}\n\ndef loader = GSH.getInstance()._getScript(\"Snippets\", Snippets.getLoader())\n\n// Manually set (now optional) binding for versions <= 1.5.3\nloader.binding.setProperty(\"out\", binding.out)\n\ndef cache = ScriptCache.getCache()\n\ndef memoryCacheSize = 0\ndef memoryCacheItems = 0\n\ncache.@cache.keySet().findAll { it.contains(\"MOD.SnippetLoader\") }.each { key->\n\tmemoryCacheSize += cache.get(key)?.size() ?: 0\n\tmemoryCacheItems++\n}\n\nprintln \"MemoryCacheItems=${memoryCacheItems}\"\nprintln \"MemoryCacheSize=${memoryCacheSize}\"\n\ndef diskCacheSize = new File(\"../lib/snippets/\").directorySize()\nprintln \"DiskCacheSize=${diskCacheSize}\"\n\ndef localListCache = new File(\"../lib/snippets/groovy/RemoteSnippetListCache.xml\")\ndef localListCacheAge = System.currentTimeMillis() - localListCache.lastModified()\nprintln \"GroovyListCacheAge=${localListCacheAge / 1000 / 60 / 60}\"\n\ndef start = System.currentTimeMillis()\ndef latestLoader = loader.load(\"loader\") // Load the loader as a test. This will also update it if needed.\nprintln \"TestSnippetLoadTime=${System.currentTimeMillis() - start}\"\n\ndef dir = new File(\"../lib/snippets/groovy/loader/\")\n\nif(dir.exists()) {\n\tdef latestVersion = Integer.MIN_VALUE.toString()\n\n\tdef regexVersionFilter = ~/^(?i)[\\d.]*(\\.groovy$|$)/\n\n\tdir.eachFileMatch(FileType.FILES, regexVersionFilter) { file->\n\t\tdef fileName = FilenameUtils.removeExtension(file.name)\n\n\t\tif(isMoreRecent(fileName, latestVersion)) {\n\t\t\tlatestVersion = fileName\n\t\t}\n\t}\n\n\tif(latestVersion != Integer.MIN_VALUE.toString()) {\n\t\tdef versionTokens = latestVersion.tokenize('.')\n\t\tprintln \"LoaderMajorVersion=${versionTokens[0]}\"\n\t\tprintln \"LoaderMinorVersion=${versionTokens[1] ?: 0}\"\n\t\tprintln \"LoaderPatchVersion=${versionTokens[2] ?: 0}\"\n\t}\n}\n\nreturn 0\n\n//////////////////\n// 1.9.1 Loader //\n//////////////////\n// Copyright 2007-2022 - LogicMonitor, Inc. All rights reserved.\n\nimport com.logicmonitor.mod.Snippets\nimport com.logicmonitor.common.sse.utils.GroovyScriptHelper\nimport com.santaba.agent.util.dns.CachedDnsResolver\nimport com.santaba.agent.util.script.ScriptCache\nimport com.santaba.agent.http.AgentHttpService\nimport com.santaba.agent.util.Settings\nimport org.apache.commons.io.FilenameUtils\nimport java.util.zip.GZIPInputStream\nimport groovy.json.JsonSlurper\nimport groovy.io.FileType\n\n/**\n * Loads the latest version of a snippet\n *\n * @param name the name of the snippet to load\n * @return a parsed script\n */\ndef load(String name) {\n\treturn load(name, \"-1\")\n}\n\n/**\n * Loads the latest version of a snippet\n *\n * @param name the name of the snippet to load\n * @param runAfterLoad indicates if the script should be executed after being loaded.\n * @return a parsed script\n */\ndef load(String name, boolean runAfterLoad) {\n\treturn load(name, \"-1\", runAfterLoad)\n}\n\n/**\n * Loads a snippet of a specific version or higher within the same major version.\n *\n * @param name the name of the snippet to load\n * @param minimumCompatibleInMajor the minimum version to load. The maximum is limited to the same major version.\n * @return a parsed script\n */\ndef load(String name, String minimumCompatibleInMajor) {\n\treturn load(name, minimumCompatibleInMajor, false)\n}\n\n/**\n * Loads a snippet of a specific version or higher within the same major version.\n *\n * @param name the name of the snippet to load\n * @param minimumCompatibleInMajor the minimum version to load. The maximum is limited to the same major version.\n * @param runAfterLoad indicates if the script should be executed after being loaded.\n * @return a parsed script\n */\ndef load(String name, String minimumCompatibleInMajor, boolean runAfterLoad) {\n\treturn loadFromString(name, get(name, minimumCompatibleInMajor, \"groovy\"), runAfterLoad)\n}\n\ndef get(String name, String language) {\n\treturn get(name, \"-1\", language)\n}\n\ndef get(String name, String minimumCompatibleInMajor, String language) {\n\tif(!(minimumCompatibleInMajor ==~ /[\\d.-]*/)) {\n\t\tthrow new Exception(\"Invalid version number\")\n\t}\n\n\tdef cache = ScriptCache.getCache()\n\n\t// Gather the Major version to use for automatic updating via filter.\n\t// It is presumed that all higher snippets within a Major revision are reverse compatible.\n\tdef majorVersion = minimumCompatibleInMajor.tokenize('.').first()\n\tdef regexVersionFilter = ~/^(?i)${majorVersion == '-1' ? '\\\\d' : majorVersion}(?=\\D)[\\d.]*(\\.${language}$|$)/\n\n\t// First, check the cache. We don't check for updates if its already cached as the cache only lasts until restart.\n\tdef cachedSnippetString = getLatestFromCollectorCache(name, minimumCompatibleInMajor, cache, language)\n\tif(cachedSnippetString) {\n\t\treturn cachedSnippetString\n\t}\n\n\tif(Settings.getSetting(\"snippet.auto.update\", \"true\") == \"false\") {\n\t\t// We are configured to not update automatically. If we can grab something from the filesystem first, do so.\n\t\tdef stringFromFilesystem = getLatestFromFilesystem(name, minimumCompatibleInMajor, regexVersionFilter, cache, language)\n\t\tif(stringFromFilesystem) {\n\t\t\treturn stringFromFilesystem\n\t\t}\n\t}\n\n\t// Snippet not in the cache.\n\tdef stringFromServer = getLatestFromServer(name, minimumCompatibleInMajor, regexVersionFilter, cache, language)\n\tif(stringFromServer) {\n\t\treturn stringFromServer\n\t}\n\n\t// Snippet not in local cache or online. Search the filesystem cache (last resort).\n\tdef stringFromFilesystem = getLatestFromFilesystem(name, minimumCompatibleInMajor, regexVersionFilter, cache, language)\n\tif(stringFromFilesystem) {\n\t\treturn stringFromFilesystem\n\t}\n\n\tthrow new Exception(\"Unable to load Snippet - ${name}\")\n}\n\nprivate def loadFromGzB64(String gzB64) {\n\treturn loadFromGzB64(\"tmp\", gzB64)\n}\n\nprivate def loadFromGzB64(String name, String gzB64) {\n\treturn loadFromString(name, new GZIPInputStream(new ByteArrayInputStream(gzB64.decodeBase64())).getText())\n}\n\nprivate def loadFromGzB64(String name, String gzB64, Boolean runAfterLoad) {\n\treturn loadFromString(name, new GZIPInputStream(new ByteArrayInputStream(gzB64.decodeBase64())).getText(), runAfterLoad)\n}\n\nprivate def loadFromB64(String b64) {\n\treturn loadFromB64(\"tmp\", new String(b64.decodeBase64()))\n}\n\nprivate def loadFromB64(String name, String b64) {\n\treturn loadFromString(name, new String(b64.decodeBase64()))\n}\n\nprivate def loadFromB64(String name, String b64, Boolean runAfterLoad) {\n\treturn loadFromString(name, new String(b64.decodeBase64()), runAfterLoad)\n}\n\nprivate def loadFromString(String name, String scriptString) {\n\treturn loadFromString(name, scriptString, false)\n}\n\nprivate def loadFromString(String name, String scriptString, boolean runAfterLoad) {\n\tdef script = null\n\n\t// Clear the binding if needed\n\tinitLoader()\n\n\t// Check if this loader is the one in the GSH, if we don't already know.\n\tif(!getBinding().hasVariable(\"GSH\")) {\n\t\t// Get an instance of the loader from the GSH\n\t\tdef loaderGSH = GroovyScriptHelper.getInstance()._getScript(\"Snippets\", Snippets.getLoader())\n\t\t// Check if our class is the exact same one from the SSE\n\t\tthis.setProperty(\"GSH\", this.getClass() == loaderGSH.getClass())\n\t}\n\n\tif(getBinding().getVariable(\"GSH\")) {\n\t\t// This loader is using GroovyScriptHelper, we can use it here too.\n\t\tscript = GroovyScriptHelper.getInstance()._getScript(name, scriptString)\n\t} else {\n\t\t// Use a standard GroovyShell.\n\t\tscript = new GroovyShell().parse(scriptString)\n\t}\n\n\t// The new scripts also need fresh bindings...\n\tdef scriptBinding = new Binding()\n\n\t// ...but we forward the output printstream if we have it.\n\tif(getBinding().hasVariable(\"out\")) {\n\t\tscriptBinding.setProperty(\"out\", getBinding().out)\n\t}\n\n\tscript.setBinding(scriptBinding)\n\n\tif(runAfterLoad) {\n\t\tscript.run()\n\t}\n\n\treturn script\n}\n\nprivate def isMoreRecent(newValue, oldValue) {\n\t[newValue,oldValue]*.tokenize('.')*.collect { it as int }.with { u, v ->\n\t\treturn (([u,v].transpose().findResult{ x,y -> x <=> y ?: null } ?: u.size() <=> v.size()) == 1)\n\t}\n}\n\nprivate def getLatestFromCollectorCache(name, minimumCompatibleInMajor, cache, language) {\n\t// For now we just grab the version in the cache without searching for it.\n\treturn cache.get(\"MOD.SnippetLoader.${language}.${name}_${minimumCompatibleInMajor}\")\n}\n\nprivate def getLatestFromServer(name, minimumCompatibleInMajor, versionFilter, cache, language) {\n\tdef timeout = Settings.getSetting(\"snippet.cache.timeout\", \"86400000\").toInteger()\n\tdef ageLeft = timeout\n\n\tdef fileList = cache.get(\"MOD.SnippetLoader.RemoteSnippets.${language}\")\n\n\tif(!fileList) { // The cache doesn't contain a list of remote Snippets.\n\t\tdef localListCache = new File(\"../lib/snippets/${language}/RemoteSnippetListCache.xml\")\n\n\t\tdef localListCacheAge = System.currentTimeMillis() - localListCache.lastModified()\n\n\t\tif (localListCacheAge < timeout) { // We still have a cache file within expiry.\n\t\t\t// Grab the cached Snippet list from file and put it back into the cache.\n\t\t\tfileList = localListCache.text\n\t\t\tageLeft = timeout - localListCacheAge\n\t\t\tcache.set(\"MOD.SnippetLoader.RemoteSnippets.${language}\", fileList, ageLeft)\n\t\t}\n\t\telse { // We have no cache file or it is expired. Download fresh version.\n\t\t\t// Grab the latest Snippet list from the API and put it into the file and collector cache.\n\t\t\ttry {\n\t\t\t\t// Ideally, we'd request a specific language here but if we do we get the complete scripts for all of them.\n\t\t\t\tdef response = httpWithAgent(\"/santaba/api/getStoredScripts\")\n\t\t\t\tdef feed = new XmlSlurper().parseText(response)\n\n\t\t\t\tif(feed.status.text() == \"200\") {\n\t\t\t\t\tfileList = response\n\n\t\t\t\t\tcache.set(\"MOD.SnippetLoader.RemoteSnippets.${language}\", fileList, timeout)\n\t\t\t\t\tlocalListCache.getParentFile().mkdirs()\n\t\t\t\t\tlocalListCache.write(fileList)\n\n\t\t\t\t\tif(name != \"loader\") {\n\t\t\t\t\t\tload(\"loader\") // If we've already had to cache a fresh server response, checking for loader updates is almost free.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (ex) { /* Connection to server failed */ }\n\t\t}\n\t}\n\n\tif(fileList) { // We have an up to date list of remote Snippets available.\n\t\tdef feed = new XmlSlurper().parseText(fileList)\n\n\t\tdef latestVersion = Integer.MIN_VALUE.toString()\n\n\t\t// Identify the latest version of the Snippet available on the server.\n\t\tfeed.scripts.children().each {\n\t\t\tif(it.language.text() == language && // This is the correct language.\n\t\t\t it.status.text() == \"active\" && // The script is active\n\t\t\t it.name.text() == name && // The name is the same\n\t\t\t it.version.text() ==~ versionFilter && // The version is valid\n\t\t\t isMoreRecent(it.version.text(), latestVersion) && // The version is more recent than the previous best\n\t\t\t (it.version.text() == minimumCompatibleInMajor || isMoreRecent(it.version.text(), minimumCompatibleInMajor))) { // The version is equal or better than our desired one.\n\t\t\t\tlatestVersion = it.version.text()\n\t\t\t}\n\t\t}\n\n\t\tdef localSnippetFile = new File(\"../lib/snippets/${language}/${name}/${latestVersion}.${language}\")\n\n\t\tif(latestVersion != Integer.MIN_VALUE.toString()) {\n\t\t\tdef scriptString = \"\"\n\n\t\t\tif(localSnippetFile.exists()) { // Load from disk if we already have this version cached on disk.\n\t\t\t\tscriptString = localSnippetFile.text\n\t\t\t}\n\t\t\telse { // Request from API if this is the first time we've seen it.\n\t\t\t\ttry {\n\t\t\t\t\tdef urlName = URLEncoder.encode(name)\n\t\t\t\t\tdef version = URLEncoder.encode(latestVersion)\n\n\t\t\t\t\tdef response = httpWithAgent(\"/santaba/api/getStoredScripts?language=${language}&name=${urlName}&version=${version}\")\n\t\t\t\t\tdef xml = new XmlSlurper().parseText(response)\n\n\t\t\t\t\tif(xml.status == \"200\") {\n\t\t\t\t\t\txml.scripts.children().each {\n\t\t\t\t\t\t\tscriptString = it.payload.text()\n\n\t\t\t\t\t\t\tlocalSnippetFile.getParentFile().mkdirs()\n\t\t\t\t\t\t\tlocalSnippetFile.write(scriptString)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (ex) { /* Connection to server failed */ }\n\t\t\t}\n\n\t\t\tif(scriptString) { // We have a script! Add to the collector cache and return it.\n\t\t\t\tif(Settings.getSetting(\"snippet.memorycache\", \"true\") != \"false\") {\n\t\t\t\t\tcache.set(\"MOD.SnippetLoader.${language}.${name}_${minimumCompatibleInMajor}\", scriptString, ageLeft)\n\t\t\t\t\tcache.set(\"MOD.SnippetLoader.${language}.${name}_${latestVersion}\", scriptString, ageLeft)\n\t\t\t\t}\n\n\t\t\t\treturn scriptString\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null\n}\n\nprivate def getLatestFromFilesystem(name, minimumCompatibleInMajor, versionFilter, cache, language) {\n\tdef dir = new File(\"../lib/snippets/${language}/${name}/\")\n\n\tif(dir.exists()) {\n\t\tdef latestFile\n\t\tdef latestVersion = Integer.MIN_VALUE.toString()\n\n\t\tdir.eachFileMatch(FileType.FILES, versionFilter) { file->\n\t\t\tdef fileName = FilenameUtils.removeExtension(file.name)\n\n\t\t\tif(isMoreRecent(fileName, latestVersion) && (fileName == minimumCompatibleInMajor || isMoreRecent(fileName, minimumCompatibleInMajor))) {\n\t\t\t\tlatestVersion = fileName\n\t\t\t\tlatestFile = file\n\t\t\t}\n\t\t}\n\n\t\tif(latestVersion != Integer.MIN_VALUE.toString()) {\n\t\t\tdef scriptString = latestFile.text\n\n\t\t\tif(Settings.getSetting(\"snippet.memorycache\", \"true\") != \"false\") {\n\t\t\t\tcache.set(\"MOD.SnippetLoader.${language}.${name}_${minimumCompatibleInMajor}\", scriptString, 1800000)\n\t\t\t\tcache.set(\"MOD.SnippetLoader.${language}.${name}_${latestVersion}\", scriptString, 1800000)\n\t\t\t}\n\n\t\t\treturn scriptString\n\t\t}\n\t}\n\n\treturn null\n}\n\nprivate httpWithAgent(apiEndpoint) {\n\ttry {\n\t\tdef company = Settings.getSetting(Settings.AGENT_COMPANY)\n\t\tdef agentID = Settings.getSetting(Settings.AGENT_ID)\n\t\tdef apiCred = URLEncoder.encode(Settings.getSetting(Settings.AGENT_CREDENTIAL))\n\n\t\tdef url = \"https://${company}.logicmonitor.com${apiEndpoint}${apiEndpoint.contains('?') ? '&' : '?'}company=${company}&id=${agentID}&credential=${apiCred}\"\n\n\t\tif(Settings.getSettingBoolean(\"proxy.enable\", false)) {\n\t\t\tdef proxy = new Proxy(Proxy.Type.HTTP, \n\t\t\t\t\t\t\t\tnew InetSocketAddress(Settings.getSetting(\"proxy.host\"), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSettings.getSettingInt(\"proxy.port\", 8080)))\n\n\t\t\treturn url.toURL()\n\t\t\t\t\t.openConnection(proxy)\n\t\t\t\t\t.getInputStream()\n\t\t\t\t\t.text\n\t\t} else {\n\t\t\treturn url.toURL()\n\t\t\t\t\t .text\n\t\t}\n\t} catch (e) {\n\t\tdef ahs = new AgentHttpService(Settings.getProperties())\n\n\t\tif(new File(\"../conf/agentdns.cache\").exists()) {\n\t\t\tahs.setCachedDnsResolver(new CachedDnsResolver(\"../conf/agentdns.cache\"))\n\t\t}\n\n\t\tdef con = ahs.getMedia(apiEndpoint)\n\n\t\treturn con.getContentEncoding() == \"gzip\" ? new GZIPInputStream(con.getInputStream()).getText() :\n\t\t\t\t\t\t\t\t\t\t\t\t\tcon.getContent().text\n\t}\n}\n\ndef clearCacheForUpdate(check = -1) {\n\tdef cache = ScriptCache.getCache()\n\n\tif(check == -1) {\n\t\tdef checkInt = String.format(\"%04d\", 1000 + new Random().nextInt(9000));\n\n\t\tcache.set(\"MOD.SnippetLoader.CacheClearCheck\", checkInt.toString(), 60000)\n\n\t\tprintln \"WARNING\\t: This removes Snippet information from the cache (forcing an update from the server) and should never be automated.\"\n\t\tprintln \"\\t If you understand and wish to continue, provide the code '${checkInt}' to this function within the next minute.\"\n\n\t\treturn\n\t}\n\n\tif(check.toString() != cache.get(\"MOD.SnippetLoader.CacheClearCheck\")) {\n\t\tprintln \"INFO\\t: Invalid confirmation code provided.\"\n\t\treturn\n\t}\n\n\tprintln \"INFO\\t: Removing Snippet information from Collector Cache.\"\n\n\tcache.@cache.keySet().findAll { it.contains(\"MOD.SnippetLoader\") }.each { key->\n\t\tcache.remove(key)\n\t}\n\n\tnew File(\"../lib/snippets/\").eachDir { language->\n\t\tdef localListCache = new File(\"${language.getPath()}/RemoteSnippetListCache.xml\")\n\n\t\tif(localListCache.exists()) {\n\t\t\tlocalListCache.delete()\n\t\t}\n\t}\n\n\tprintln \"INFO\\t: Removal successful. Snippets should check for updates when next used.\"\n}\n\n/**\n * Checks if we've cleaned the binding. If not, sets up a new one and sets debug flag if needed.\n */\nprivate def initLoader() {\n\tif(!getBinding().hasVariable(\"SnippetInitialized\")) {\n\t\t// We are in a binding we didn't create.\n\t\tdef newBinding = new Binding()\n\n\t\t// If we've got an output printstream, preserve it.\n\t\tif(getBinding().hasVariable(\"out\")) {\n\t\t\tnewBinding.setProperty(\"out\", getBinding().out)\n\t\t}\n\n\t\t// If the debug flag file or setting exists, set debug variable\n\t\tif(Settings.getSetting(\"snippet.debug\", \"false\") == \"true\") {\n\t\t\tnewBinding.setProperty(\"debug\", true)\n\t\t}\n\n\t\tthis.setBinding(newBinding)\n\t\tthis.setProperty(\"SnippetInitialized\", true)\n\t}\n}\n\n\ndef withBinding(moduleBinding) {\n\tinitLoader()\n\tthis.setProperty(\"out\", moduleBinding.getVariable(\"out\"))\n\treturn this\n}\n\n/**\n * Sets the loader to use caching via the GroovyScriptHelper\n */\ndef useGSH() {\n\tinitLoader()\n\tthis.setProperty(\"GSH\", true)\n\treturn this\n}\n\n/**\n * Sets the loader to use the GroovyShell\n */\ndef useGS() {\n\tinitLoader()\n\tthis.setProperty(\"GSH\", false)\n\treturn this\n}\n\n/**\n * Gets the version number\n */\ndef getLoaderVersion() {\n\treturn \"1.9.1\"\n}"}, "datapoints": [{"name": "DiskCacheSize", "description": "total size in bytes of snippets in the collector's disk cache", "interpretMethod": "namevalue", "interpretExpr": "DiskCacheSize", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "GroovyListCacheAge", "description": "age of the snippet list cache in hours. This indicates how much time has passed since we checked for updates.", "interpretMethod": "namevalue", "interpretExpr": "GroovyListCacheAge", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "LaterThanEmbed", "description": "Returns 1 if the installed Loader version is later than the one embedded.", "interpretMethod": "namevalue", "interpretExpr": "LaterThanEmbed", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "LoaderMajorVersion", "description": "Current major version of the loader", "interpretMethod": "namevalue", "interpretExpr": "LoaderMajorVersion", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "LoaderMinorVersion", "description": "Current minor version of the loader", "interpretMethod": "namevalue", "interpretExpr": "LoaderMinorVersion", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "LoaderPatchVersion", "description": "Current patch version of the loader", "interpretMethod": "namevalue", "interpretExpr": "LoaderPatchVersion", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemoryCacheItems", "description": "Count of items related to snippets in the collector's memory cache", "interpretMethod": "namevalue", "interpretExpr": "MemoryCacheItems", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "MemoryCacheSize", "description": "total size in bytes of items related to snippets in the collector's memory cache", "interpretMethod": "namevalue", "interpretExpr": "MemoryCacheSize", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "TestSnippetLoadTime", "description": "Milliseconds taken to load a test snippet", "interpretMethod": "namevalue", "interpretExpr": "TestSnippetLoadTime", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Embed Comparison", "title": "Embed Comparison", "verticalLabel": "0=false 1=true", "min": 0.0, "max": 1.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "LaterThanEmbed", "datapointName": "LaterThanEmbed", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Installed later than Embedded", "color": "green", "datapointName": "LaterThanEmbed", "isVirtual": false}]}, {"name": "Items in Memory", "title": "Items in Memory", "verticalLabel": "#", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "MemoryCacheItems", "datapointName": "MemoryCacheItems", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Snippet Items", "color": "blue", "datapointName": "MemoryCacheItems", "isVirtual": false}]}, {"name": "Loader Version", "title": "Loader Version", "verticalLabel": "version", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "LoaderMajorVersion", "datapointName": "LoaderMajorVersion", "consolidationFn": "average"}, {"name": "LoaderMinorVersion", "datapointName": "LoaderMinorVersion", "consolidationFn": "average"}, {"name": "LoaderPatchVersion", "datapointName": "LoaderPatchVersion", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Major", "color": "navy", "datapointName": "LoaderMajorVersion", "isVirtual": false}, {"type": "line", "legend": "Minor", "color": "aqua", "datapointName": "LoaderMinorVersion", "isVirtual": false}, {"type": "line", "legend": "Patch", "color": "fuchsia", "datapointName": "LoaderPatchVersion", "isVirtual": false}]}, {"name": "Snippet Cache Size", "title": "Snippet Cache Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "DiskCacheSize", "datapointName": "DiskCacheSize", "consolidationFn": "average"}, {"name": "MemoryCacheSize", "datapointName": "MemoryCacheSize", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Disk", "color": "gray", "datapointName": "DiskCacheSize", "isVirtual": false}, {"type": "area", "legend": "Memory", "color": "yellow", "datapointName": "MemoryCacheSize", "isVirtual": false}]}, {"name": "Test Snippet Load Time", "title": "Test Snippet Load Time", "verticalLabel": "milliseconds", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "TestSnippetLoadTime", "datapointName": "TestSnippetLoadTime", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Load Time", "color": "red", "datapointName": "TestSnippetLoadTime", "isVirtual": false}]}, {"name": "Version Cache Age", "title": "Version Cache Age", "verticalLabel": "hours", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "GroovyListCacheAge", "datapointName": "GroovyListCacheAge", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Groovy Snippet List", "color": "olive", "datapointName": "GroovyListCacheAge", "isVirtual": false}]}]}

×DataSource: Kubernetes_KSM_EndPoints (198)

{"name": "Kubernetes_KSM_EndPoints", "description": "Monitors Kubernetes Endpoints via KSM", "appliesTo": "hasCategory(\"KubernetesEndPoint\") && hasCategory(\"KubernetesKSM\")", "searchKeywords": "kubernetes,endpoint,ksm", "displayedAs": "Kubernetes Endpoint", "collectionInterval": "1m", "collectionMethod": "openmetrics", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"url": "##auto.ksm.service.url##", "connectTimeoutMs": 2000, "readTimeoutMs": 10000, "followRedirect": false}, "datapoints": [{"name": "age", "description": "Endpoint age in seconds.", "config": {}, "interpretMethod": "expression", "interpretExpr": "now()-kubeEndpointCreated", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ageDays", "description": "Endpoint age in days.", "config": {}, "interpretMethod": "expression", "interpretExpr": "age/86400", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeEndpointAddressAvailable", "description": "Number of addresses available in endpoint.", "config": {"metricName": "kube_endpoint_address_available", "instanceLabel": "namespace=\"##auto.namespace##\",endpoint=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",endpoint=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeEndpointAddressNotReady", "description": "Number of addresses not ready in endpoint", "config": {"metricName": "kube_endpoint_address_not_ready", "instanceLabel": "namespace=\"##auto.namespace##\",endpoint=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",endpoint=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertBody": "The host ##HOSTNAME## is reporting ##VALUE## addresses not in ready state, hence raised ##LEVEL## alert.\nThis started at ##START## - or ##DURATION## ago."}, {"name": "kubeEndpointCreated", "description": "Unix creation timestamp of when the Endpoint was created.", "config": {"metricName": "kube_endpoint_created", "instanceLabel": "namespace=\"##auto.namespace##\",endpoint=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",endpoint=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "AddressAvailibility", "title": "AddressAvailibility", "verticalLabel": "count", "min": -1.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeEndpointAddressAvailable", "datapointName": "kubeEndpointAddressAvailable", "consolidationFn": "max"}, {"name": "kubeEndpointAddressNotReady", "datapointName": "kubeEndpointAddressNotReady", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Address Available", "color": "silver", "datapointName": "kubeEndpointAddressAvailable", "isVirtual": false}, {"type": "line", "legend": "Address Not Ready", "color": "orange", "datapointName": "kubeEndpointAddressNotReady", "isVirtual": false}]}, {"name": "Age", "title": "Age", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ageDays", "datapointName": "ageDays", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Age", "color": "silver", "datapointName": "ageDays", "isVirtual": false}]}]}

×DataSource: Kubernetes_KSM_PersistentVolumeClaims (197)

{"name": "Kubernetes_KSM_PersistentVolumeClaims", "description": "Monitors kubernetes PersistentVolumeClaims via KSM", "appliesTo": "hasCategory(\"KubernetesPersistentVolumeClaim\") && hasCategory(\"KubernetesKSM\")", "searchKeywords": "kube-state-metrics,kubernetes,ksm,k8s,persistentvolumeclaims", "displayedAs": "Kubernetes PersistentVolumeClaim", "collectionInterval": "1m", "collectionMethod": "openmetrics", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"url": "##auto.ksm.service.url##", "connectTimeoutMs": 2000, "readTimeoutMs": 10000, "followRedirect": false}, "datapoints": [{"name": "kubePersistentVolumeClaimResourceRequestsStorageBytes", "description": "The capacity of storage requested by the persistent volume claim.", "config": {"metricName": "kube_persistentvolumeclaim_resource_requests_storage_bytes", "instanceLabel": "namespace=\"##auto.namespace##\",persistentvolumeclaim=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",persistentvolumeclaim=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePersistentVolumeClaimStatusPhaseBound", "description": "The phase the persistent volume claim is currently in.", "config": {"metricName": "kube_persistentvolumeclaim_status_phase", "instanceLabel": "namespace=\"##auto.namespace##\",persistentvolumeclaim=\"##auto.name##\",phase=\"Bound\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",persistentvolumeclaim=\"##auto.name##\",phase=\"Bound\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePersistentVolumeClaimStatusPhaseLost", "description": "The phase the persistent volume claim is currently in.", "config": {"metricName": "kube_persistentvolumeclaim_status_phase", "instanceLabel": "namespace=\"##auto.namespace##\",persistentvolumeclaim=\"##auto.name##\",phase=\"Lost\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",persistentvolumeclaim=\"##auto.name##\",phase=\"Lost\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePersistentVolumeClaimStatusPhasePending", "description": "The phase the persistent volume claim is currently in.", "config": {"metricName": "kube_persistentvolumeclaim_status_phase", "instanceLabel": "namespace=\"##auto.namespace##\",persistentvolumeclaim=\"##auto.name##\",phase=\"Pending\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",persistentvolumeclaim=\"##auto.name##\",phase=\"Pending\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePresistentVolumeClaimStatusPhase", "description": "Status code that returns phase of the PersistentVolume.\n\nStatus Codes:\n0=Bound\n1=Pending\n2=Lost", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(gt(kubePersistentVolumeClaimStatusPhaseBound,0),0,(if(gt(kubePersistentVolumeClaimStatusPhasePending,0),1,(if(gt(kubePersistentVolumeClaimStatusPhaseLost,0),2,3)))))", "type": "gauge", "dataType": 7, "min": "0", "max": "3", "threshold": ">= 2", "noData": "Trigger warning alert", "triggerInterval": 5, "clearInterval": 5, "alertBody": "The host ##HOSTNAME## is reporting ##VALUE## value which means PersistentVolumeClaim is in Lost phase, hence raised ##LEVEL## alert.\nThis started at ##START## - or ##DURATION## ago."}], "graphs": [{"name": "Status Phase", "title": "Status Phase", "verticalLabel": "0=bound,1=pending,2=lost", "min": 0.0, "max": 3.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubePresistentVolumeClaimStatusPhase", "datapointName": "kubePresistentVolumeClaimStatusPhase", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "kubePresistentVolumeClaimStatusPhase", "color": "silver", "datapointName": "kubePresistentVolumeClaimStatusPhase", "isVirtual": false}]}, {"name": "Storage Requested", "title": "Storage Requested", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "kubePersistentVolumeClaimResourceRequestsStorageBytes", "datapointName": "kubePersistentVolumeClaimResourceRequestsStorageBytes", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "kubePersistentVolumeClaimResourceRequestsStorageBytes", "color": "silver", "datapointName": "kubePersistentVolumeClaimResourceRequestsStorageBytes", "isVirtual": false}]}]}

×DataSource: Kubernetes_KSM_Resources (139)

{"name": "Kubernetes_KSM_Resources", "description": "Monitors kube-state-metrics resources", "appliesTo": "hasCategory(\"KubernetesKSM\") && hasCategory(\"KubernetesService\") && getPropValue(\"kubernetes.label.app.kubernetes.io/name\") == \"kube-state-metrics\"", "searchKeywords": "kube-state-metrics,kubernetes,ksm,k8s", "displayedAs": "Kubernetes KSM Resources", "collectionInterval": "1m", "collectionMethod": "openmetrics", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_openmetrics", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"url": "##auto.ksm.selfmonitor.url##", "headers": "", "metricName": "kube_state_metrics.*", "instanceLabel": "resource", "groupLabel": "", "connectTimeoutMs": "2000", "readTimeoutMs": "10000", "followRedirect": false, "instancePropertyTags": "resource"}, "groupMethod": "ilp"}, "collectionAttrs": {"url": "##auto.ksm.selfmonitor.url##", "connectTimeoutMs": 2000, "readTimeoutMs": 10000, "followRedirect": false}, "datapoints": [{"name": "kubeStateMetricsListTotalError", "description": "Number of total resource list in kube-state-metrics with result error", "config": {"metricName": "kube_state_metrics_list_total", "instanceLabel": "result=\"error\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "result=\"error\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeStateMetricsListTotalSuccess", "description": "Number of total resource list in kube-state-metrics with result success", "config": {"metricName": "kube_state_metrics_list_total", "instanceLabel": "result=\"success\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "result=\"success\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeStateMetricsWatchTotalError", "description": "Number of total resource watches in kube-state-metrics with result error", "config": {"metricName": "kube_state_metrics_watch_total", "instanceLabel": "result=\"error\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "result=\"error\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeStateMetricsWatchTotalSuccess", "description": "Number of total resource watches in kube-state-metrics with result success", "config": {"metricName": "kube_state_metrics_watch_total", "instanceLabel": "result=\"success\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "result=\"success\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Kube State Metrics Resource Watch", "title": "Kube State Metrics Resource Watch", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeStateMetricsListTotalError", "datapointName": "kubeStateMetricsListTotalError", "consolidationFn": "max"}, {"name": "kubeStateMetricsListTotalSuccess", "datapointName": "kubeStateMetricsListTotalSuccess", "consolidationFn": "max"}, {"name": "kubeStateMetricsWatchTotalError", "datapointName": "kubeStateMetricsWatchTotalError", "consolidationFn": "max"}, {"name": "kubeStateMetricsWatchTotalSuccess", "datapointName": "kubeStateMetricsWatchTotalSuccess", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "kubeStateMetricsListTotalError", "color": "orange", "datapointName": "kubeStateMetricsListTotalError", "isVirtual": false}, {"type": "line", "legend": "kubeStateMetricsListTotalSuccess", "color": "silver", "datapointName": "kubeStateMetricsListTotalSuccess", "isVirtual": false}, {"type": "line", "legend": "kubeStateMetricsWatchTotalError", "color": "red2", "datapointName": "kubeStateMetricsWatchTotalError", "isVirtual": false}, {"type": "line", "legend": "kubeStateMetricsWatchTotalSuccess", "color": "olive", "datapointName": "kubeStateMetricsWatchTotalSuccess", "isVirtual": false}]}]}

×DataSource: Telnet_Interactive_Dynamic (2319)

{"name": "Telnet_Interactive_Dynamic", "description": "Common module for handling generic Telnet Interactive config collection.\nDynamic configs are set to not alert on change by default.", "appliesTo": "auto.config.type.telnet", "group": "Common ConfigSources", "searchKeywords": "configuration,telnet,networking,switch", "technicalNotes": "-Host Properties-\ntelet.user\t\t\t: Username\ntelnet.pass\t\t: Password\ntelnet.port\t\t: Port (optional)\ntelnet.enable.pass\t: Privilege escalation password (optional)\nconfig.filter \t\t: Regex used to filter output. Can be used for removing MOTD messages or personal information. (optional)", "displayedAs": "Dynamic Configs (Telnet)", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 2, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "// Telnet Interactive Dynamic AD\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/ \nimport com.santaba.agent.util.Settings\nimport java.security.MessageDigest\nimport groovy.json.JsonSlurper\nimport groovy.json.JsonOutput\n\ndef version = hostProps.get(\"auto.config.version\", \"-1\")\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"telnet.user\", hostProps.get(\"config.user\", hostProps.get(\"ssh.user\")))\ndef pass = hostProps.get(\"telnet.pass\", hostProps.get(\"config.pass\", hostProps.get(\"ssh.pass\")))\ndef port = hostProps.get(\"auto.config.port\", \"23\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef pipe = hostProps.get(\"auto.config.commands.pipe\", \"\")\ndef fmtc = hostProps.get(\"config.commands.formatting\", hostProps.get(\"auto.config.commands.formatting\", \"\")).tokenize(\",\")\ndef endc = hostProps.get(\"auto.config.commands.end\", \"exit\").tokenize(\",\")\ndef cmds = hostProps.get(\"config.commands.dynamic\", hostProps.get(\"auto.config.commands.dynamic\", \"\")).split(\",\").flatten()\n\ndef customPrompt = hostProps.get(\"config.prompt\", hostProps.get(\"auto.config.prompt\", \"\"))\n\ndef escalationCommand = hostProps.get(\"auto.config.escalation.command\", \"enable\")\n\ndef enblePass = hostProps.get(\"telnet.enable.pass\", hostProps.get(\"config.enable.pass\", hostProps.get(\"ssh.enable.pass\", \"\")))\ndef loginPass = hostProps.get(\"telnet.login.pass\", hostProps.get(\"config.login.pass\", hostProps.get(\"ssh.login.pass\", \"\")))\n\ndef promptFilter = hostProps.get(\"ssh.prompt.filter\", \"true\") ==~ \"1|true\"\n\n// Accepts strings in the format LINE_REGEX=>RESPONSE seperated by commas to be acted upon.\ndef customLineResponse = hostProps.get(\"config.custom.response\", \"\")\n\t\t\t\t\t\t\t\t .split(\",\")\n\t\t\t\t\t\t\t\t .collectEntries { it.tokenize(\"=>\").with { [(it[0]):it[1]] }}\n\t\t\t\t\t\t\t\t .findAll{ it.value != null }\n\ndef promptMaxSize = hostProps.get(\"config.prompt.maxsize\", \"64\").toInteger() // A sanity check when looking for a prompt.\n\ndef connectTimeout = 30000 // Timeout attempting a connection.\ndef readingTimeout = 60000 // Timeout waiting on data.\ndef maximumTimeout = (Settings.getSettingInt(\"discover.script.timeoutInSec\", 300) - 10) * 1000 // The maximum time to attempt collection.\n\nenum States {\n\tRUNNING, FAILED, SUCCESSFUL, INVALID, PARTIAL\n}\n\ndef ansiEscapeRegex = /[\\u001B\\u009B][\\[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))/\ndef newLineCharacters = [\"\\n\", \"\\r\", \"\\u001b[J\", \"\\u001b[1J\", \"\\u001b[2J\", \"\\u001b[K\", \"\\u001b[1K\", \"\\u001b[2K\"]\n\ndef log = []\ndef gotOutput = false\n\n// By shuffling the potential instances, we eventually allow for each to get the full timeout period.\nCollections.shuffle(cmds)\n\ncmds.grep().each { it->\n\tdef (wild, alias) = it.split('=', 2)\n\t\n\twild += pipe\n\n\tdef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\n\tdef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\n\tnew File(fileCache.getParent()).mkdirs()\n\t\n\tif(fileCache.exists()) {\n\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\t\tgotOutput = true\n\t\treturn\n\t}\n\n\tdef stats = [:]\n\tstats[\"type\"] = \"TELNET\"\n\tstats[\"host\"] = host\n\tstats[\"wildvalue\"] = wild\n\n\tdef socket = new Socket()\n\tsocket.setSoTimeout(readingTimeout)\n\n\tdef state = States.RUNNING\n\n\ttry {\n\t\tlog.push(\"INFO : Connecting\")\n\t\tsocket.connect(new InetSocketAddress(host, port.toInteger()), connectTimeout)\n\n\t\tdef startTime = System.currentTimeMillis()\n\n\t\tdef txStream = new PrintStream(socket.getOutputStream(), true)\n\t\tdef rxStream = socket.getInputStream()\n\n\t\tdef authenticated = false\n\t\tdef ansiMode = false\n\t\tdef cursor = 0\n\t\tdef inputData = new byte[Math.max(5242880, Settings.getSettingInt(Settings.CONFIGURATION_MAX_LENGTH, 5242880))]\n\n\t\tdef prompt = customPrompt ?: \"\"\n\t\tdef enablePrompt = \"\"\n\t\tdef promptIndex = -1\n\t\tdef promptValidated = false\n\t\tdef filteredPrompt = false\n\t\t\n\t\tdef stdout = \"\"\n\n\t\tdef formattingCommands = fmtc\n\t\tdef collectingCommands = [wild]\n\t\tdef escalationCommands = enblePass ? [escalationCommand] : []\n\t\tdef extraLoginCommands = loginPass ? [\"login\"] : []\n\t\tdef credentialCommands = [pass] // Used to store auth crednetials so we don't attempt them multiple times\n\n\t\tdef lastCollectionCommand = \"\"\n\t\tdef lastCollectionIndex = -1\n\t\tdef lastSize = -1\n\n\t\twhile(state == States.RUNNING) {\n\t\t\tdef availableBytes = rxStream.available()\n\n\t\t\tif(availableBytes > 0) {\n\t\t\t\tif(cursor + availableBytes >= inputData.length) {\n\t\t\t\t\tlog.push(\"ERROR : Size of output greater than configured maximum\")\n\t\t\t\t\tstats[\"rawSize\"] = cursor + availableBytes\n\t\t\t\t\tstate = States.PARTIAL // We may want to set this to failed in some circumstance\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tcursor += rxStream.read(inputData, cursor, Math.min(availableBytes, inputData.length - cursor))\n\n\t\t\t\tstdout = new String(inputData[0..<cursor] as byte[])\n\n\t\t\t\tdef endLineIndex = 0\n\t\t\t\tdef endLineSize = 0\n\n\t\t\t\tnewLineCharacters.each { lineEnd->\n\t\t\t\t\tdef lineEndIndexCheck = stdout.lastIndexOf(lineEnd)\n\n\t\t\t\t\tif(lineEndIndexCheck > endLineIndex &&\n\t\t\t\t\t lineEndIndexCheck + lineEnd.length() < stdout.size()) {\n\t\t\t\t\t\tendLineIndex = lineEndIndexCheck\n\t\t\t\t\t\tendLineSize = lineEnd.length()\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(stdout.size() != lastSize) {\n\t\t\t\t\tlastSize = stdout.size()\n\t\t\t\t\tdef lastLn = stdout.substring(endLineIndex + endLineSize)\n\n\t\t\t\t\tif(ansiMode || lastLn.contains(\"\\u001b\")) {\n\t\t\t\t\t\tif(!ansiMode) {\n\t\t\t\t\t\t\tansiMode = true\n\t\t\t\t\t\t\tlog.push(\"INFO : Entering ANSI mode\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastLn = lastLn.replaceAll(ansiEscapeRegex,\"\")\n\t\t\t\t\t}\n\n\t\t\t\t\tlastLn = lastLn.trim()\n\t\t\t\t\t\n\t\t\t\t\tif(filteredPrompt && lastLn ==~ /.*\\d+:\\d+:\\d+:.*/) { // If times may be involved, strip all times from line\n\t\t\t\t\t\tlog.push(\"INFO : Line [${lastLn}] needs edit for filtered prompt\")\n\t\t\t\t\t\tlastLn = lastLn.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\t\tlog.push(\"INFO : Line changed to ${lastLn}\")\n\t\t\t\t\t}\n\n\t\t\t\t\tdef isPrompt = false\n\t\n\t\t\t\t\tif(lastLn ==~ /(?i)^(PLEASE ENTER LOGIN NAME|USER\\s?(NAME)?)\\s*:.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : User Line\")\n\t\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Username\")\n\t\t\t\t\t\t\ttxStream.print(\"${user}\\n\")\n\t\t\t\t\t\t\tauthenticated = true\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(lastLn ==~ /(?i)^(PLEASE ENTER )?PASS(WORD)?\\s*:.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : Pass Line\")\n\t\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\t\tif(credentialCommands) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Sending Password\")\n\t\t\t\t\t\t\t\ttxStream.print(\"${credentialCommands.pop()}\\n\")\n\t\t\t\t\t\t\t\tauthenticated = true\n\t\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(lastLn ==~ /(?i).*PRESS (ENTER|ANY KEY) TO CONTINUE.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : Press key Line\")\n\t\t\t\t\t\ttxStream.print(\"\\n\")\n\t\t\t\t\t} else if(lastLn ==~ /(?i)<?\\s*-+\\s*MORE\\s*(-+|or \\(?q\\)?uit)\\s*>?.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : More Line\")\n\t\t\t\t\t\ttxStream.print(\" \")\n\t\t\t\t\t} else if((prompt && lastLn == prompt) || (enablePrompt && lastLn == enablePrompt)) {\n\t\t\t\t\t\tdef newPromptIndex = stdout.lastIndexOf(prompt)\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(enablePrompt) { // Check if there is a more recent EnablePrompt\n\t\t\t\t\t\t\tnewPromptIndex = Math.max(newPromptIndex, stdout.lastIndexOf(enablePrompt))\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(newPromptIndex != promptIndex || filteredPrompt) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Prompt Line\")\n\t\t\t\t\t\t\tpromptIndex = newPromptIndex\n\t\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.push(\"WARN : Duplicate Prompt Index\")\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdef customFound = false\n\n\t\t\t\t\t\tcustomLineResponse.each { match, response->\n\t\t\t\t\t\t\tif(lastLn ==~ match) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Custom Response Line Found - ${lastLn}\")\n\t\t\t\t\t\t\t\ttxStream.print(response)\n\t\t\t\t\t\t\t\tcustomFound = true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!customFound) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Unknown Line - ${lastLn}\")\n\n\t\t\t\t\t\t\tif(!prompt && !lastLn.isAllWhitespace() && authenticated) {\n\t\t\t\t\t\t\t\tif(lastLn.length() < promptMaxSize) {\n\t\t\t\t\t\t\t\t\tlog.push(\"INFO : Assuming line is prompt - ${lastLn}\")\n\t\t\t\t\t\t\t\t\tprompt = lastLn\n\t\t\t\t\t\t\t\t\tpromptIndex = stdout.lastIndexOf(prompt)\n\t\t\t\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tlog.push(\"INFO : Line greater than ${promptMaxSize} characters. Unlikely to be a prompt.\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isPrompt) { // A prompt is waiting for input. We do our actions here.\n\t\t\t\t\t\tif(!prompt) { // If we found a prompt with our prompt line cleared, update it\n\t\t\t\t\t\t\tprompt = enablePrompt\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(promptFilter && !promptValidated) {\n\t\t\t\t\t\t\tif(prompt ==~ /.*\\d+:\\d+:\\d+:.*/) {\n\t\t\t\t\t\t\t log.push(\"INFO : Prompt contains time\")\n\t\t\t\t\t\t\t prompt = prompt.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\t\t\t log.push(\"INFO : Time removed from prompt [${prompt}]\")\n\t\t\t\t\t\t\t\tfilteredPrompt = true\n\t\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpromptChecked = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(extraLoginCommands) {\n\t\t\t\t\t\t\tdef command = extraLoginCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Performing Second Login\")\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\t\tcredentialCommands = [loginPass]\n\t\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t\t} else if(escalationCommands) {\n\t\t\t\t\t\t\tdef command = escalationCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Escalation command\")\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\n\t\t\t\t\t\t\tif(command == \"enable\") {\n\t\t\t\t\t\t\t\tenablePrompt = \"${prompt[0..-2]}#\"\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Setting enable prompt to - ${enablePrompt}\")\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsleep(1000) // Prompt change unknown. Wait for change.\n\t\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcredentialCommands = [enblePass]\n\t\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t\t} else if(formattingCommands) {\n\t\t\t\t\t\t\tdef command = formattingCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Formatting command - ${command}\")\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\t} else if (collectingCommands) {\n\t\t\t\t\t\t\tdef command = collectingCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Collecting command - ${command}\")\n\t\t\t\t\t\t\tlastCollectionIndex = cursor\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.push(\"INFO : Command output finished\")\n\n\t\t\t\t\t\t\tdef out = stdout.substring(lastCollectionIndex)\n\n\t\t\t\t\t\t\tif(ansiMode) {\n\t\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .replaceAll(/\\n.*\\e\\[2(J|K)/, \"\\n\")\n\t\t\t\t\t\t\t\t\t\t .split(/\\n|\\r\\n|\\e\\[(1|2)?(J|K)/)\n\t\t\t\t\t\t\t\t\t\t .tail() // Remove first (prompt) line\n\t\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t .replaceAll(ansiEscapeRegex, \"\")\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .split(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t .tail()\n\t\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\t\t\t\t\tout = \"\"\n\t\t\t\t\t \t\t}\n\n\t\t\t\t\t\t\tif(out) {\n\t\t\t\t\t\t\t\tstate = States.SUCCESSFUL\n\t\t\t\t\t\t\t\tstats[\"size\"] = out.length()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlog.push(\"ERROR : Captured output was invalid\")\n\t\t\t\t\t\t\t\tlog.push(\"--- Command Result ---\")\n\t\t\t\t\t\t\t\tlog.push(stdout.substring(lastCollectionIndex))\n\t\t\t\t\t\t\t\tlog.push(\"----------------------\")\n\t\t\t\t\t\t\t\tstate = States.INVALID\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(System.currentTimeMillis() > startTime + maximumTimeout && state != States.SUCCESSFUL) { // Timeout\n\t\t\t\tif(lastCollectionIndex > 0) {\n\t\t\t\t\tdef out = stdout.substring(lastCollectionIndex)\n\t\t\t\t\t\t\t\t\t.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t.replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t.split(\"\\n\") // We probably need to handle cursor resets codes too\n\t\t\t\t\t\t\t\t\t.tail() // Remove first (prompt) line\n\t\t\t\t\t\t\t\t\t.join(\"\\n\")\n\t\t\t\t\t\t\t\t\t.trim()\n\t\t\t\t\t\t\t\t\t.replaceAll(\"(\\\\Q${prompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\t\t\tout = \"\"\n\t\t\t\t\t}\n\n\t\t\t\t\tif(out) {\n\t\t\t\t\t\tlog.push(\"Info : Partial output recieved\")\n\t\t\t\t\t\tstate = States.PARTIAL\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate = States.FAILED\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlog.push(\"ERROR : Timeout looking for valid line\")\n\t\t\t\t\tlog.push(\"--- Standard Output ---\")\n\t\t\t\t\tlog.push(stdout)\n\t\t\t\t\tlog.push(\"-----------------------\")\n\n\t\t\t\t\tstate = States.FAILED\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(state != States.RUNNING) { // Collection finished. Quit out safely.\n\t\t\t\tlog.push(\"INFO : Collection finished with ${state} state\")\n\t\t\t\ttxStream.print(\"\\u0003\") // Send a SIGINT to interupt anything running.\n\t\t\t\t\n\t\t\t\tendc.each {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlog.push(\"INFO : Sending End command - ${it}\")\n\t\t\t\t\t\ttxStream.print(\"${it}\\n\")\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tlog.push(\"WARN : Failed to send - ${it}\")\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tThread.sleep(1)\n\t\t}\n\t} catch (e) {\n\t\t\tlog.push(\"ERROR : Exception - ${e.message}\")\n\t} finally {\n\t\ttry {\n\t\t\tsocket?.close()\n\t\t} catch (e) {\n\t\t\tlog.push(\"ERROR : Exception Closing - ${e.message}\")\n\t\t}\n\n\t\tif(state == States.SUCCESSFUL || state == States.PARTIAL) {\n\t\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\n\t\t\tstats[\"time\"] = System.currentTimeMillis()\n\t\t\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\t\t\tstats[\"state\"] = state\n\t\t\tstats[\"log\"] = log\n\n\t\t\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\t\t\tfileCache.write(json)\n\n\t\t\tgotOutput = true\n\t\t}\n\t}\n}\n\nif(gotOutput) {\n\treturn 0\n} else {\n\tprintln log.join(\"\\n\")\n\treturn 1\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "// Telnet Interactive Collection\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.util.Settings\nimport java.security.MessageDigest\nimport groovy.json.JsonOutput\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"telnet.user\", hostProps.get(\"config.user\", hostProps.get(\"ssh.user\")))\ndef pass = hostProps.get(\"telnet.pass\", hostProps.get(\"config.pass\", hostProps.get(\"ssh.pass\")))\ndef port = hostProps.get(\"auto.config.port\", \"23\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef fmtc = hostProps.get(\"config.commands.formatting\", hostProps.get(\"auto.config.commands.formatting\", \"\")).tokenize(\",\")\ndef endc = hostProps.get(\"auto.config.commands.end\", \"exit\").tokenize(\",\")\n\ndef customPrompt = hostProps.get(\"config.prompt\", hostProps.get(\"auto.config.prompt\", \"\"))\n\ndef escalationCommand = hostProps.get(\"auto.config.escalation.command\", \"enable\")\n\ndef enblePass = hostProps.get(\"telnet.enable.pass\", hostProps.get(\"config.enable.pass\", hostProps.get(\"ssh.enable.pass\", \"\")))\ndef loginPass = hostProps.get(\"telnet.login.pass\", hostProps.get(\"config.login.pass\", hostProps.get(\"ssh.login.pass\", \"\")))\n\ndef promptFilter = hostProps.get(\"ssh.prompt.filter\", \"true\") ==~ \"1|true\"\n\n// Accepts strings in the format LINE_REGEX=>RESPONSE seperated by commas to be acted upon.\ndef customLineResponse = hostProps.get(\"config.custom.response\", \"\")\n\t\t\t\t\t\t\t\t .split(\",\")\n\t\t\t\t\t\t\t\t .collectEntries { it.tokenize(\"=>\").with { [(it[0]):it[1]] }}\n\t\t\t\t\t\t\t\t .findAll{ it.value != null }\n\ndef promptMaxSize = hostProps.get(\"config.prompt.maxsize\", \"64\").toInteger() // A sanity check when looking for a prompt.\n\ndef connectTimeout = 30000 // Timeout attempting a connection.\ndef readingTimeout = 60000 // Timeout waiting on data.\ndef maximumTimeout = (Settings.getSettingInt(\"configcollector.script.timeout\", 300) - 5) * 1000 // The maximum time to attempt collection.\n\ndef wild = instanceProps.get(\"wildvalue\")\ndef version = instanceProps.get(\"auto.config.instance.version\", \"-1\")\n\nif(version != \"-1\" && version != hostProps.get(\"auto.config.version\", \"-1\")) {\n\tprintln \"Collecting the incorrect version. AD needs to run successfully at least once to update props.\"\n\treturn 1\n}\n\nenum States {\n\tRUNNING, FAILED, SUCCESSFUL, INVALID, PARTIAL\n}\n\ndef ansiEscapeRegex = /[\\u001B\\u009B][\\[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))/\ndef newLineCharacters = [\"\\n\", \"\\r\", \"\\u001B[J\", \"\\u001B[1J\", \"\\u001B[2J\", \"\\u001B[K\", \"\\u001B[1K\", \"\\u001B[2K\"]\n\ndef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\ndef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\nnew File(fileCache.getParent()).mkdirs()\n\ndef stats = [:]\nstats[\"type\"] = \"TELNET\"\nstats[\"host\"] = host\nstats[\"wildvalue\"] = wild\n\ndef socket = new Socket()\nsocket.setSoTimeout(readingTimeout)\n\ndef state = States.RUNNING\n\ndef log = []\ndef stdout = \"\"\n\ndef startTime = System.currentTimeMillis()\n\ntry {\n\tsocket.connect(new InetSocketAddress(host, port.toInteger()), connectTimeout)\n\n\tdef txStream = new PrintStream(socket.getOutputStream(), true)\n\tdef rxStream = socket.getInputStream()\n\n\tdef authenticated = false\n\tdef ansiMode = false\n\tdef cursor = 0\n\tdef inputData = new byte[Math.max(5242880, Settings.getSettingInt(Settings.CONFIGURATION_MAX_LENGTH, 5242880))]\n\n\tdef prompt = customPrompt ?: \"\"\n\tdef enablePrompt = \"\"\n\tdef promptIndex = -1\n\tdef promptValidated = false\n\tdef filteredPrompt = false\n\n\tdef formattingCommands = fmtc\n\tdef collectingCommands = [wild]\n\tdef escalationCommands = enblePass ? [escalationCommand] : []\n\tdef extraLoginCommands = loginPass ? [\"login\"] : []\n\tdef credentialCommands = [pass] // Used to store auth crednetials so we don't attempt them multiple times\n\n\tdef lastCollectionCommand = \"\"\n\tdef lastCollectionIndex = -1\n\tdef lastSize = -1\n\n\tdef readTimeoutEnd = System.currentTimeMillis() + readingTimeout\n\n\twhile(state == States.RUNNING) {\n\t\tdef availableBytes = rxStream.available()\n\n\t\tif(availableBytes > 0) {\n\t\t\tif(cursor + availableBytes >= inputData.length) {\n\t\t\t\tlog.push(\"ERROR : Size of output greater than configured maximum\")\n\t\t\t\tstats[\"rawSize\"] = cursor + availableBytes\n\t\t\t\tstate = States.FAILED\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tcursor += rxStream.read(inputData, cursor, Math.min(availableBytes, inputData.length - cursor))\n\n\t\t\treadTimeoutEnd = System.currentTimeMillis() + readingTimeout\n\n\t\t\tstdout = new String(inputData[0..<cursor] as byte[])\n\n\t\t\tdef endLineIndex = 0\n\t\t\tdef endLineSize = 0\n\n\t\t\tnewLineCharacters.each { lineEnd->\n\t\t\t\tdef lineEndIndexCheck = stdout.lastIndexOf(lineEnd)\n\n\t\t\t\tif(lineEndIndexCheck > endLineIndex &&\n\t\t\t\t lineEndIndexCheck + lineEnd.length() < stdout.size()) {\n\t\t\t\t\tendLineIndex = lineEndIndexCheck\n\t\t\t\t\tendLineSize = lineEnd.length()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(stdout.size() != lastSize) {\n\t\t\t\tlastSize = stdout.size()\n\t\t\t\tdef lastLn = stdout.substring(endLineIndex + endLineSize)\n\n\t\t\t\tif(ansiMode || lastLn.contains(\"\\u001B\")) {\n\t\t\t\t\tif(!ansiMode) {\n\t\t\t\t\t\tansiMode = true\n\t\t\t\t\t\tlog.push(\"INFO : Entering ANSI mode\")\n\t\t\t\t\t}\n\t\t\t\t\tlastLn = lastLn.replaceAll(ansiEscapeRegex,\"\")\n\t\t\t\t}\n\n\t\t\t\tlastLn = lastLn.trim()\n\t\t\t\t\n\t\t\t\tif(filteredPrompt && lastLn ==~ /.*\\d+:\\d+:\\d+:.*/) { // If times may be involved, strip all times from line\n\t\t\t\t\tlog.push(\"INFO : Line [${lastLn}] needs edit for filtered prompt\")\n\t\t\t\t\tlastLn = lastLn.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\tlog.push(\"INFO : Line changed to ${lastLn}\")\n\t\t\t\t}\n\n\t\t\t\tdef isPrompt = false\n\n\t\t\t\tif(lastLn ==~ /(?i)^(PLEASE ENTER LOGIN NAME|USER\\s?(NAME)?)\\s*:.*/) {\n\t\t\t\t\tlog.push(\"INFO : User Line\")\n\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\tlog.push(\"INFO : Sending Username\")\n\t\t\t\t\t\ttxStream.print(\"${user}\\n\")\n\t\t\t\t\t\tauthenticated = true\n\t\t\t\t\t}\n\t\t\t\t} else if(lastLn ==~ /(?i)^(PLEASE ENTER )?PASS(WORD)?\\s*:.*/) {\n\t\t\t\t\tlog.push(\"INFO : Pass Line\")\n\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\tif(credentialCommands) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Password\")\n\t\t\t\t\t\t\ttxStream.print(\"${credentialCommands.pop()}\\n\")\n\t\t\t\t\t\t\tauthenticated = true\n\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if(lastLn ==~ /(?i).*PRESS (ENTER|ANY KEY) TO CONTINUE.*/) {\n\t\t\t\t\tlog.push(\"INFO : Press key Line\")\n\t\t\t\t\ttxStream.print(\"\\n\")\n\t\t\t\t} else if(lastLn ==~ /(?i)<?\\s*-+\\s*MORE\\s*(-+|or \\(?q\\)?uit)\\s*>?.*/) {\n\t\t\t\t\tlog.push(\"INFO : More Line\")\n\t\t\t\t\ttxStream.print(\" \")\n\t\t\t\t} else if((prompt && lastLn == prompt) || (enablePrompt && lastLn == enablePrompt)) {\n\t\t\t\t\tdef newPromptIndex = stdout.lastIndexOf(prompt)\n\t\t\t\t\t\n\t\t\t\t\tif(enablePrompt) { // Check if there is a more recent EnablePrompt\n\t\t\t\t\t\tnewPromptIndex = Math.max(newPromptIndex, stdout.lastIndexOf(enablePrompt))\n\t\t\t\t\t}\n\n\t\t\t\t\tif(newPromptIndex != promptIndex || filteredPrompt) {\n\t\t\t\t\t\tlog.push(\"INFO : Prompt Line\")\n\t\t\t\t\t\tpromptIndex = newPromptIndex\n\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.push(\"WARN : Duplicate Prompt Index\")\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdef customFound = false\n\n\t\t\t\t\tcustomLineResponse.each { match, response->\n\t\t\t\t\t\tif(lastLn ==~ match) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Custom Response Line Found - ${lastLn}\")\n\t\t\t\t\t\t\ttxStream.print(response)\n\t\t\t\t\t\t\tcustomFound = true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!customFound) {\n\t\t\t\t\t\tlog.push(\"INFO : Unknown Line - ${lastLn}\")\n\n\t\t\t\t\t\tif(!prompt && !lastLn.isAllWhitespace() && authenticated) {\n\t\t\t\t\t\t\tif(lastLn.length() < promptMaxSize) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Assuming line is prompt - ${lastLn}\")\n\t\t\t\t\t\t\t\tprompt = lastLn\n\t\t\t\t\t\t\t\tpromptIndex = stdout.lastIndexOf(prompt)\n\t\t\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Line greater than ${promptMaxSize} characters. Unlikely to be a prompt.\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(isPrompt) { // A prompt is waiting for input. We do our actions here.\n\t\t\t\t\tif(!prompt) { // If we found a prompt with our prompt line cleared, update it\n\t\t\t\t\t\tprompt = enablePrompt\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tif(promptFilter && !promptValidated) {\n\t\t\t\t\t\tif(prompt ==~ /.*\\d+:\\d+:\\d+:.*/) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Prompt contains time\")\n\t\t\t\t\t\t\tprompt = prompt.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\t\t\tlog.push(\"INFO : Time removed from prompt [${prompt}]\")\n\t\t\t\t\t\t\tfilteredPrompt = true\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tpromptChecked = true\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tif(extraLoginCommands) {\n\t\t\t\t\t\tdef command = extraLoginCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Performing Second Login\")\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\tcredentialCommands = [loginPass]\n\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t} else if(escalationCommands) {\n\t\t\t\t\t\tdef command = escalationCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Sending Escalation command\")\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\n\t\t\t\t\t\tif(command == \"enable\") {\n\t\t\t\t\t\t\tenablePrompt = \"${prompt[0..-2]}#\"\n\t\t\t\t\t\t\tlog.push(\"INFO : Setting enable prompt to - ${enablePrompt}\")\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsleep(1000) // Prompt change unknown. Wait for change.\n\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcredentialCommands = [enblePass]\n\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t} else if(formattingCommands) {\n\t\t\t\t\t\tdef command = formattingCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Sending Formatting command - ${command}\")\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t}else if (collectingCommands) {\n\t\t\t\t\t\tdef command = collectingCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Sending Collecting command - ${command}\")\n\t\t\t\t\t\tlastCollectionIndex = cursor\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.push(\"INFO : Command output finished\")\n\n\t\t\t\t\t\tdef out = stdout.substring(lastCollectionIndex)\n\n\t\t\t\t\t\tif(ansiMode) {\n\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t .replaceAll(/\\n.*\\e\\[2(J|K)/, \"\\n\")\n\t\t\t\t\t\t\t\t\t .split(/\\n|\\r\\n|\\e\\[(1|2)?(J|K)/)\n\t\t\t\t\t\t\t\t\t .tail() // Remove first (prompt) line\n\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t .replaceAll(ansiEscapeRegex, \"\")\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t .split(\"\\n\")\n\t\t\t\t\t\t\t\t\t .tail()\n\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\t\t\t\tout = \"\"\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(out) {\n\t\t\t\t\t\t\tprint out\n\n\t\t\t\t\t\t\tstate = States.SUCCESSFUL\n\t\t\t\t\t\t\tstats[\"size\"] = out.length()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.push(\"ERROR : Captured output was invalid\")\n\t\t\t\t\t\t\tlog.push(\"--- Command Result ---\")\n\t\t\t\t\t\t\tlog.push(stdout.substring(lastCollectionIndex))\n\t\t\t\t\t\t\tlog.push(\"----------------------\")\n\t\t\t\t\t\t\tstate = States.INVALID\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(System.currentTimeMillis() > readTimeoutEnd && state != States.SUCCESSFUL) { // Timeout\n\t\t\tlog.push(\"ERROR : Timeout looking for valid line\")\n\t\t\tlog.push(\"--- Standard Output ---\")\n\t\t\tlog.push(stdout)\n\t\t\tlog.push(\"-----------------------\")\n\n\t\t\tstate = States.FAILED\n\t\t}\n\n\n\t\tif(System.currentTimeMillis() > startTime + maximumTimeout) { // Timeout\n\t\t\tlog.push(\"ERROR : Maximum timeout reached\")\n\t\t\t\n\t\t\tstate = States.FAILED\n\t\t}\n\n\t\tif(state != States.RUNNING) { // Collection finished. Quit out safely.\n\t\t\tlog.push(\"INFO : Collection finished with ${state} state\")\n\t\t\ttxStream.print(\"\\u0003\") // Send a SIGINT to interupt anything running.\n\t\t\t\n\t\t\tendc.each {\n\t\t\t\ttry {\n\t\t\t\t\tlog.push(\"INFO : Sending End command - ${it}\")\n\t\t\t\t\ttxStream.print(\"${it}\\n\")\n\t\t\t\t} catch (ex) {\n\t\t\t\t\tlog.push(\"WARN : Failed to send - ${it}\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\n\t\tThread.sleep(1)\n\t}\n} catch (e) {\n\tlog.push(\"ERROR : Exception - ${e.message}\")\n} finally {\n\ttry {\n\t\tsocket?.close()\n\t} catch (e) {\n\t\tlog.push(\"ERROR : Exception Closing - ${e.message}\")\n\t}\n\n\tstats[\"time\"] = System.currentTimeMillis()\n\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\tstats[\"state\"] = state\n\tstats[\"log\"] = log\n\tstats[\"rawSize\"] = stats[\"rawSize\"] ?: stdout.length()\n\n\tif(state != States.SUCCESSFUL) {\n\t\tprintln \"--- Collection Failure Log ---\"\n\t\tprint log.join(\"\\n\")\n\t}\n\n\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\tfileCache.write(json)\n\n\treturn (state == States.SUCCESSFUL) ? 0 : 1\n}"}, "configChecks": [{"name": "NoAlert", "description": "", "type": "groovy", "attrs": {"script": "/* Dynamic configs are expected to change frequently.\nA groovy script check allows the config to update without firing an alert.*/\nreturn 0"}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Telnet_Interactive_Standard (2317)

{"name": "Telnet_Interactive_Standard", "description": "Common module for handling generic Telnet Interactive config collection.\nDynamic configs are set to not alert on change by default.", "appliesTo": "auto.config.type.telnet", "group": "Common ConfigSources", "searchKeywords": "configuration,telnet,networking,switch", "technicalNotes": "-Host Properties-\ntelet.user\t\t\t: Username\ntelnet.pass\t\t: Password\ntelnet.port\t\t: Port (optional)\ntelnet.enable.pass\t: Privilege escalation password (optional)\nconfig.filter \t\t: Regex used to filter output. Can be used for removing MOTD messages or personal information. (optional)", "displayedAs": "Standard Configs (Telnet Interactive)", "collectionInterval": "1h", "collectionMethod": "script", "multiInstance": true, "dataSourceType": 2, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_script", "discoveryInterval": "0m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"type": "groovy", "content": "// Telnet Interactive Standard AD\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/ \nimport com.santaba.agent.util.Settings\nimport java.security.MessageDigest\nimport groovy.json.JsonSlurper\nimport groovy.json.JsonOutput\n\ndef version = hostProps.get(\"auto.config.version\", \"-1\")\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"telnet.user\", hostProps.get(\"config.user\", hostProps.get(\"ssh.user\")))\ndef pass = hostProps.get(\"telnet.pass\", hostProps.get(\"config.pass\", hostProps.get(\"ssh.pass\")))\ndef port = hostProps.get(\"auto.config.port\", \"23\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef pipe = hostProps.get(\"auto.config.commands.pipe\", \"\")\ndef fmtc = hostProps.get(\"config.commands.formatting\", hostProps.get(\"auto.config.commands.formatting\", \"\")).tokenize(\",\")\ndef endc = hostProps.get(\"auto.config.commands.end\", \"exit\").tokenize(\",\")\ndef cmds = hostProps.get(\"config.commands.standard\", hostProps.get(\"auto.config.commands.standard\", \"\")).split(\",\").flatten()\n\ndef customPrompt = hostProps.get(\"config.prompt\", hostProps.get(\"auto.config.prompt\", \"\"))\n\ndef escalationCommand = hostProps.get(\"auto.config.escalation.command\", \"enable\")\n\ndef enblePass = hostProps.get(\"telnet.enable.pass\", hostProps.get(\"config.enable.pass\", hostProps.get(\"ssh.enable.pass\", \"\")))\ndef loginPass = hostProps.get(\"telnet.login.pass\", hostProps.get(\"config.login.pass\", hostProps.get(\"ssh.login.pass\", \"\")))\n\ndef promptFilter = hostProps.get(\"ssh.prompt.filter\", \"true\") ==~ \"1|true\"\n\n// Accepts strings in the format LINE_REGEX=>RESPONSE seperated by commas to be acted upon.\ndef customLineResponse = hostProps.get(\"config.custom.response\", \"\")\n\t\t\t\t\t\t\t\t .split(\",\")\n\t\t\t\t\t\t\t\t .collectEntries { it.tokenize(\"=>\").with { [(it[0]):it[1]] }}\n\t\t\t\t\t\t\t\t .findAll{ it.value != null }\n\ndef promptMaxSize = hostProps.get(\"config.prompt.maxsize\", \"64\").toInteger() // A sanity check when looking for a prompt.\n\ndef connectTimeout = 30000 // Timeout attempting a connection.\ndef readingTimeout = 60000 // Timeout waiting on data.\ndef maximumTimeout = (Settings.getSettingInt(\"discover.script.timeoutInSec\", 300) - 10) * 1000 // The maximum time to attempt collection.\n\nenum States {\n\tRUNNING, FAILED, SUCCESSFUL, INVALID, PARTIAL\n}\n\ndef ansiEscapeRegex = /[\\u001B\\u009B][\\[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))/\ndef newLineCharacters = [\"\\n\", \"\\r\", \"\\u001b[J\", \"\\u001b[1J\", \"\\u001b[2J\", \"\\u001b[K\", \"\\u001b[1K\", \"\\u001b[2K\"]\n\ndef log = []\ndef gotOutput = false\n\n// By shuffling the potential instances, we eventually allow for each to get the full timeout period.\nCollections.shuffle(cmds)\n\ncmds.grep().each { it->\n\tdef (wild, alias) = it.split('=', 2)\n\t\n\twild += pipe\n\n\tdef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\n\tdef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\n\tnew File(fileCache.getParent()).mkdirs()\n\t\n\tif(fileCache.exists()) {\n\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\t\tgotOutput = true\n\t\treturn\n\t}\n\n\tdef stats = [:]\n\tstats[\"type\"] = \"TELNET\"\n\tstats[\"host\"] = host\n\tstats[\"wildvalue\"] = wild\n\n\tdef socket = new Socket()\n\tsocket.setSoTimeout(readingTimeout)\n\n\tdef state = States.RUNNING\n\n\ttry {\n\t\tlog.push(\"INFO : Connecting\")\n\t\tsocket.connect(new InetSocketAddress(host, port.toInteger()), connectTimeout)\n\n\t\tdef startTime = System.currentTimeMillis()\n\n\t\tdef txStream = new PrintStream(socket.getOutputStream(), true)\n\t\tdef rxStream = socket.getInputStream()\n\n\t\tdef authenticated = false\n\t\tdef ansiMode = false\n\t\tdef cursor = 0\n\t\tdef inputData = new byte[Math.max(5242880, Settings.getSettingInt(Settings.CONFIGURATION_MAX_LENGTH, 5242880))]\n\n\t\tdef prompt = customPrompt ?: \"\"\n\t\tdef enablePrompt = \"\"\n\t\tdef promptIndex = -1\n\t\tdef promptValidated = false\n\t\tdef filteredPrompt = false\n\t\t\n\t\tdef stdout = \"\"\n\n\t\tdef formattingCommands = fmtc\n\t\tdef collectingCommands = [wild]\n\t\tdef escalationCommands = enblePass ? [escalationCommand] : []\n\t\tdef extraLoginCommands = loginPass ? [\"login\"] : []\n\t\tdef credentialCommands = [pass] // Used to store auth crednetials so we don't attempt them multiple times\n\n\t\tdef lastCollectionCommand = \"\"\n\t\tdef lastCollectionIndex = -1\n\t\tdef lastSize = -1\n\n\t\twhile(state == States.RUNNING) {\n\t\t\tdef availableBytes = rxStream.available()\n\n\t\t\tif(availableBytes > 0) {\n\t\t\t\tif(cursor + availableBytes >= inputData.length) {\n\t\t\t\t\tlog.push(\"ERROR : Size of output greater than configured maximum\")\n\t\t\t\t\tstats[\"rawSize\"] = cursor + availableBytes\n\t\t\t\t\tstate = States.PARTIAL // We may want to set this to failed in some circumstance\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tcursor += rxStream.read(inputData, cursor, Math.min(availableBytes, inputData.length - cursor))\n\n\t\t\t\tstdout = new String(inputData[0..<cursor] as byte[])\n\n\t\t\t\tdef endLineIndex = 0\n\t\t\t\tdef endLineSize = 0\n\n\t\t\t\tnewLineCharacters.each { lineEnd->\n\t\t\t\t\tdef lineEndIndexCheck = stdout.lastIndexOf(lineEnd)\n\n\t\t\t\t\tif(lineEndIndexCheck > endLineIndex &&\n\t\t\t\t\t lineEndIndexCheck + lineEnd.length() < stdout.size()) {\n\t\t\t\t\t\tendLineIndex = lineEndIndexCheck\n\t\t\t\t\t\tendLineSize = lineEnd.length()\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(stdout.size() != lastSize) {\n\t\t\t\t\tlastSize = stdout.size()\n\t\t\t\t\tdef lastLn = stdout.substring(endLineIndex + endLineSize)\n\n\t\t\t\t\tif(ansiMode || lastLn.contains(\"\\u001b\")) {\n\t\t\t\t\t\tif(!ansiMode) {\n\t\t\t\t\t\t\tansiMode = true\n\t\t\t\t\t\t\tlog.push(\"INFO : Entering ANSI mode\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastLn = lastLn.replaceAll(ansiEscapeRegex,\"\")\n\t\t\t\t\t}\n\n\t\t\t\t\tlastLn = lastLn.trim()\n\t\t\t\t\t\n\t\t\t\t\tif(filteredPrompt && lastLn ==~ /.*\\d+:\\d+:\\d+:.*/) { // If times may be involved, strip all times from line\n\t\t\t\t\t\tlog.push(\"INFO : Line [${lastLn}] needs edit for filtered prompt\")\n\t\t\t\t\t\tlastLn = lastLn.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\t\tlog.push(\"INFO : Line changed to ${lastLn}\")\n\t\t\t\t\t}\n\n\t\t\t\t\tdef isPrompt = false\n\t\n\t\t\t\t\tif(lastLn ==~ /(?i)^(PLEASE ENTER LOGIN NAME|USER\\s?(NAME)?)\\s*:.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : User Line\")\n\t\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Username\")\n\t\t\t\t\t\t\ttxStream.print(\"${user}\\n\")\n\t\t\t\t\t\t\tauthenticated = true\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(lastLn ==~ /(?i)^(PLEASE ENTER )?PASS(WORD)?\\s*:.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : Pass Line\")\n\t\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\t\tif(credentialCommands) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Sending Password\")\n\t\t\t\t\t\t\t\ttxStream.print(\"${credentialCommands.pop()}\\n\")\n\t\t\t\t\t\t\t\tauthenticated = true\n\t\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(lastLn ==~ /(?i).*PRESS (ENTER|ANY KEY) TO CONTINUE.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : Press key Line\")\n\t\t\t\t\t\ttxStream.print(\"\\n\")\n\t\t\t\t\t} else if(lastLn ==~ /(?i)<?\\s*-+\\s*MORE\\s*(-+|or \\(?q\\)?uit)\\s*>?.*/) {\n\t\t\t\t\t\tlog.push(\"INFO : More Line\")\n\t\t\t\t\t\ttxStream.print(\" \")\n\t\t\t\t\t} else if((prompt && lastLn == prompt) || (enablePrompt && lastLn == enablePrompt)) {\n\t\t\t\t\t\tdef newPromptIndex = stdout.lastIndexOf(prompt)\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(enablePrompt) { // Check if there is a more recent EnablePrompt\n\t\t\t\t\t\t\tnewPromptIndex = Math.max(newPromptIndex, stdout.lastIndexOf(enablePrompt))\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(newPromptIndex != promptIndex || filteredPrompt) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Prompt Line\")\n\t\t\t\t\t\t\tpromptIndex = newPromptIndex\n\t\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.push(\"WARN : Duplicate Prompt Index\")\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdef customFound = false\n\n\t\t\t\t\t\tcustomLineResponse.each { match, response->\n\t\t\t\t\t\t\tif(lastLn ==~ match) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Custom Response Line Found - ${lastLn}\")\n\t\t\t\t\t\t\t\ttxStream.print(response)\n\t\t\t\t\t\t\t\tcustomFound = true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!customFound) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Unknown Line - ${lastLn}\")\n\n\t\t\t\t\t\t\tif(!prompt && !lastLn.isAllWhitespace() && authenticated) {\n\t\t\t\t\t\t\t\tif(lastLn.length() < promptMaxSize) {\n\t\t\t\t\t\t\t\t\tlog.push(\"INFO : Assuming line is prompt - ${lastLn}\")\n\t\t\t\t\t\t\t\t\tprompt = lastLn\n\t\t\t\t\t\t\t\t\tpromptIndex = stdout.lastIndexOf(prompt)\n\t\t\t\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tlog.push(\"INFO : Line greater than ${promptMaxSize} characters. Unlikely to be a prompt.\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isPrompt) { // A prompt is waiting for input. We do our actions here.\n\t\t\t\t\t\tif(!prompt) { // If we found a prompt with our prompt line cleared, update it\n\t\t\t\t\t\t\tprompt = enablePrompt\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(promptFilter && !promptValidated) {\n\t\t\t\t\t\t\tif(prompt ==~ /.*\\d+:\\d+:\\d+:.*/) {\n\t\t\t\t\t\t\t log.push(\"INFO : Prompt contains time\")\n\t\t\t\t\t\t\t prompt = prompt.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\t\t\t log.push(\"INFO : Time removed from prompt [${prompt}]\")\n\t\t\t\t\t\t\t\tfilteredPrompt = true\n\t\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpromptChecked = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(extraLoginCommands) {\n\t\t\t\t\t\t\tdef command = extraLoginCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Performing Second Login\")\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\t\tcredentialCommands = [loginPass]\n\t\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t\t} else if(escalationCommands) {\n\t\t\t\t\t\t\tdef command = escalationCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Escalation command\")\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\n\t\t\t\t\t\t\tif(command == \"enable\") {\n\t\t\t\t\t\t\t\tenablePrompt = \"${prompt[0..-2]}#\"\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Setting enable prompt to - ${enablePrompt}\")\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsleep(1000) // Prompt change unknown. Wait for change.\n\t\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcredentialCommands = [enblePass]\n\t\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t\t} else if(formattingCommands) {\n\t\t\t\t\t\t\tdef command = formattingCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Formatting command - ${command}\")\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\t} else if (collectingCommands) {\n\t\t\t\t\t\t\tdef command = collectingCommands.pop()\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Collecting command - ${command}\")\n\t\t\t\t\t\t\tlastCollectionIndex = cursor\n\t\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.push(\"INFO : Command output finished\")\n\n\t\t\t\t\t\t\tdef out = stdout.substring(lastCollectionIndex)\n\n\t\t\t\t\t\t\tif(ansiMode) {\n\t\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .replaceAll(/\\n.*\\e\\[2(J|K)/, \"\\n\")\n\t\t\t\t\t\t\t\t\t\t .split(/\\n|\\r\\n|\\e\\[(1|2)?(J|K)/)\n\t\t\t\t\t\t\t\t\t\t .tail() // Remove first (prompt) line\n\t\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t .replaceAll(ansiEscapeRegex, \"\")\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t\t .split(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t .tail()\n\t\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\t\t\t\t\tout = \"\"\n\t\t\t\t\t \t\t}\n\n\t\t\t\t\t\t\tif(out) {\n\t\t\t\t\t\t\t\tstate = States.SUCCESSFUL\n\t\t\t\t\t\t\t\tstats[\"size\"] = out.length()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlog.push(\"ERROR : Captured output was invalid\")\n\t\t\t\t\t\t\t\tlog.push(\"--- Command Result ---\")\n\t\t\t\t\t\t\t\tlog.push(stdout.substring(lastCollectionIndex))\n\t\t\t\t\t\t\t\tlog.push(\"----------------------\")\n\t\t\t\t\t\t\t\tstate = States.INVALID\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(System.currentTimeMillis() > startTime + maximumTimeout && state != States.SUCCESSFUL) { // Timeout\n\t\t\t\tif(lastCollectionIndex > 0) {\n\t\t\t\t\tdef out = stdout.substring(lastCollectionIndex)\n\t\t\t\t\t\t\t\t\t.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t.replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t.split(\"\\n\") // We probably need to handle cursor resets codes too\n\t\t\t\t\t\t\t\t\t.tail() // Remove first (prompt) line\n\t\t\t\t\t\t\t\t\t.join(\"\\n\")\n\t\t\t\t\t\t\t\t\t.trim()\n\t\t\t\t\t\t\t\t\t.replaceAll(\"(\\\\Q${prompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\t\t\tout = \"\"\n\t\t\t\t\t}\n\n\t\t\t\t\tif(out) {\n\t\t\t\t\t\tlog.push(\"Info : Partial output recieved\")\n\t\t\t\t\t\tstate = States.PARTIAL\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate = States.FAILED\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlog.push(\"ERROR : Timeout looking for valid line\")\n\t\t\t\t\tlog.push(\"--- Standard Output ---\")\n\t\t\t\t\tlog.push(stdout)\n\t\t\t\t\tlog.push(\"-----------------------\")\n\n\t\t\t\t\tstate = States.FAILED\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(state != States.RUNNING) { // Collection finished. Quit out safely.\n\t\t\t\tlog.push(\"INFO : Collection finished with ${state} state\")\n\t\t\t\ttxStream.print(\"\\u0003\") // Send a SIGINT to interupt anything running.\n\t\t\t\t\n\t\t\t\tendc.each {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlog.push(\"INFO : Sending End command - ${it}\")\n\t\t\t\t\t\ttxStream.print(\"${it}\\n\")\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tlog.push(\"WARN : Failed to send - ${it}\")\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tThread.sleep(1)\n\t\t}\n\t} catch (e) {\n\t\t\tlog.push(\"ERROR : Exception - ${e.message}\")\n\t} finally {\n\t\ttry {\n\t\t\tsocket?.close()\n\t\t} catch (e) {\n\t\t\tlog.push(\"ERROR : Exception Closing - ${e.message}\")\n\t\t}\n\n\t\tif(state == States.SUCCESSFUL || state == States.PARTIAL) {\n\t\t\tprintln \"${wild}##${alias}######auto.config.instance.version=${version}\"\n\n\t\t\tstats[\"time\"] = System.currentTimeMillis()\n\t\t\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\t\t\tstats[\"state\"] = state\n\t\t\tstats[\"log\"] = log\n\n\t\t\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\t\t\tfileCache.write(json)\n\n\t\t\tgotOutput = true\n\t\t}\n\t}\n}\n\nif(gotOutput) {\n\treturn 0\n} else {\n\tprintln log.join(\"\\n\")\n\treturn 1\n}"}, "groupMethod": "none"}, "collectionAttrs": {"type": "groovy", "content": "// Telnet Interactive Collection\n/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\nimport com.santaba.agent.util.Settings\nimport java.security.MessageDigest\nimport groovy.json.JsonOutput\n\ndef host = hostProps.get(\"system.hostname\")\ndef user = hostProps.get(\"telnet.user\", hostProps.get(\"config.user\", hostProps.get(\"ssh.user\")))\ndef pass = hostProps.get(\"telnet.pass\", hostProps.get(\"config.pass\", hostProps.get(\"ssh.pass\")))\ndef port = hostProps.get(\"auto.config.port\", \"23\")\ndef fRgx = hostProps.get(\"auto.config.filter\", \"\")\ndef cRgx = hostProps.get(\"config.filter\", \"\")\ndef sRgx = hostProps.get(\"auto.config.stoppers\", \"\")\ndef fmtc = hostProps.get(\"config.commands.formatting\", hostProps.get(\"auto.config.commands.formatting\", \"\")).tokenize(\",\")\ndef endc = hostProps.get(\"auto.config.commands.end\", \"exit\").tokenize(\",\")\n\ndef customPrompt = hostProps.get(\"config.prompt\", hostProps.get(\"auto.config.prompt\", \"\"))\n\ndef escalationCommand = hostProps.get(\"auto.config.escalation.command\", \"enable\")\n\ndef enblePass = hostProps.get(\"telnet.enable.pass\", hostProps.get(\"config.enable.pass\", hostProps.get(\"ssh.enable.pass\", \"\")))\ndef loginPass = hostProps.get(\"telnet.login.pass\", hostProps.get(\"config.login.pass\", hostProps.get(\"ssh.login.pass\", \"\")))\n\ndef promptFilter = hostProps.get(\"ssh.prompt.filter\", \"true\") ==~ \"1|true\"\n\n// Accepts strings in the format LINE_REGEX=>RESPONSE seperated by commas to be acted upon.\ndef customLineResponse = hostProps.get(\"config.custom.response\", \"\")\n\t\t\t\t\t\t\t\t .split(\",\")\n\t\t\t\t\t\t\t\t .collectEntries { it.tokenize(\"=>\").with { [(it[0]):it[1]] }}\n\t\t\t\t\t\t\t\t .findAll{ it.value != null }\n\ndef promptMaxSize = hostProps.get(\"config.prompt.maxsize\", \"64\").toInteger() // A sanity check when looking for a prompt.\n\ndef connectTimeout = 30000 // Timeout attempting a connection.\ndef readingTimeout = 60000 // Timeout waiting on data.\ndef maximumTimeout = (Settings.getSettingInt(\"configcollector.script.timeout\", 300) - 5) * 1000 // The maximum time to attempt collection.\n\ndef wild = instanceProps.get(\"wildvalue\")\ndef version = instanceProps.get(\"auto.config.instance.version\", \"-1\")\n\nif(version != \"-1\" && version != hostProps.get(\"auto.config.version\", \"-1\")) {\n\tprintln \"Collecting the incorrect version. AD needs to run successfully at least once to update props.\"\n\treturn 1\n}\n\nenum States {\n\tRUNNING, FAILED, SUCCESSFUL, INVALID, PARTIAL\n}\n\ndef ansiEscapeRegex = /[\\u001B\\u009B][\\[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))/\ndef newLineCharacters = [\"\\n\", \"\\r\", \"\\u001B[J\", \"\\u001B[1J\", \"\\u001B[2J\", \"\\u001B[K\", \"\\u001B[1K\", \"\\u001B[2K\"]\n\ndef hostMD5 = MessageDigest.getInstance('MD5').digest(\"${host}${wild}${cRgx}${version}\".bytes).encodeHex()\ndef fileCache = new File(\"../logs/ConfigStats/${hostMD5}.json\")\nnew File(fileCache.getParent()).mkdirs()\n\ndef stats = [:]\nstats[\"type\"] = \"TELNET\"\nstats[\"host\"] = host\nstats[\"wildvalue\"] = wild\n\ndef socket = new Socket()\nsocket.setSoTimeout(readingTimeout)\n\ndef state = States.RUNNING\n\ndef log = []\ndef stdout = \"\"\n\ndef startTime = System.currentTimeMillis()\n\ntry {\n\tsocket.connect(new InetSocketAddress(host, port.toInteger()), connectTimeout)\n\n\tdef txStream = new PrintStream(socket.getOutputStream(), true)\n\tdef rxStream = socket.getInputStream()\n\n\tdef authenticated = false\n\tdef ansiMode = false\n\tdef cursor = 0\n\tdef inputData = new byte[Math.max(5242880, Settings.getSettingInt(Settings.CONFIGURATION_MAX_LENGTH, 5242880))]\n\n\tdef prompt = customPrompt ?: \"\"\n\tdef enablePrompt = \"\"\n\tdef promptIndex = -1\n\tdef promptValidated = false\n\tdef filteredPrompt = false\n\n\tdef formattingCommands = fmtc\n\tdef collectingCommands = [wild]\n\tdef escalationCommands = enblePass ? [escalationCommand] : []\n\tdef extraLoginCommands = loginPass ? [\"login\"] : []\n\tdef credentialCommands = [pass] // Used to store auth crednetials so we don't attempt them multiple times\n\n\tdef lastCollectionCommand = \"\"\n\tdef lastCollectionIndex = -1\n\tdef lastSize = -1\n\n\tdef readTimeoutEnd = System.currentTimeMillis() + readingTimeout\n\n\twhile(state == States.RUNNING) {\n\t\tdef availableBytes = rxStream.available()\n\n\t\tif(availableBytes > 0) {\n\t\t\tif(cursor + availableBytes >= inputData.length) {\n\t\t\t\tlog.push(\"ERROR : Size of output greater than configured maximum\")\n\t\t\t\tstats[\"rawSize\"] = cursor + availableBytes\n\t\t\t\tstate = States.FAILED\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tcursor += rxStream.read(inputData, cursor, Math.min(availableBytes, inputData.length - cursor))\n\n\t\t\treadTimeoutEnd = System.currentTimeMillis() + readingTimeout\n\n\t\t\tstdout = new String(inputData[0..<cursor] as byte[])\n\n\t\t\tdef endLineIndex = 0\n\t\t\tdef endLineSize = 0\n\n\t\t\tnewLineCharacters.each { lineEnd->\n\t\t\t\tdef lineEndIndexCheck = stdout.lastIndexOf(lineEnd)\n\n\t\t\t\tif(lineEndIndexCheck > endLineIndex &&\n\t\t\t\t lineEndIndexCheck + lineEnd.length() < stdout.size()) {\n\t\t\t\t\tendLineIndex = lineEndIndexCheck\n\t\t\t\t\tendLineSize = lineEnd.length()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(stdout.size() != lastSize) {\n\t\t\t\tlastSize = stdout.size()\n\t\t\t\tdef lastLn = stdout.substring(endLineIndex + endLineSize)\n\n\t\t\t\tif(ansiMode || lastLn.contains(\"\\u001B\")) {\n\t\t\t\t\tif(!ansiMode) {\n\t\t\t\t\t\tansiMode = true\n\t\t\t\t\t\tlog.push(\"INFO : Entering ANSI mode\")\n\t\t\t\t\t}\n\t\t\t\t\tlastLn = lastLn.replaceAll(ansiEscapeRegex,\"\")\n\t\t\t\t}\n\n\t\t\t\tlastLn = lastLn.trim()\n\t\t\t\t\n\t\t\t\tif(filteredPrompt && lastLn ==~ /.*\\d+:\\d+:\\d+:.*/) { // If times may be involved, strip all times from line\n\t\t\t\t\tlog.push(\"INFO : Line [${lastLn}] needs edit for filtered prompt\")\n\t\t\t\t\tlastLn = lastLn.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\tlog.push(\"INFO : Line changed to ${lastLn}\")\n\t\t\t\t}\n\n\t\t\t\tdef isPrompt = false\n\n\t\t\t\tif(lastLn ==~ /(?i)^(PLEASE ENTER LOGIN NAME|USER\\s?(NAME)?)\\s*:.*/) {\n\t\t\t\t\tlog.push(\"INFO : User Line\")\n\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\tlog.push(\"INFO : Sending Username\")\n\t\t\t\t\t\ttxStream.print(\"${user}\\n\")\n\t\t\t\t\t\tauthenticated = true\n\t\t\t\t\t}\n\t\t\t\t} else if(lastLn ==~ /(?i)^(PLEASE ENTER )?PASS(WORD)?\\s*:.*/) {\n\t\t\t\t\tlog.push(\"INFO : Pass Line\")\n\t\t\t\t\tif(lastLn.endsWith(':')) {\n\t\t\t\t\t\tif(credentialCommands) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Sending Password\")\n\t\t\t\t\t\t\ttxStream.print(\"${credentialCommands.pop()}\\n\")\n\t\t\t\t\t\t\tauthenticated = true\n\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if(lastLn ==~ /(?i).*PRESS (ENTER|ANY KEY) TO CONTINUE.*/) {\n\t\t\t\t\tlog.push(\"INFO : Press key Line\")\n\t\t\t\t\ttxStream.print(\"\\n\")\n\t\t\t\t} else if(lastLn ==~ /(?i)<?\\s*-+\\s*MORE\\s*(-+|or \\(?q\\)?uit)\\s*>?.*/) {\n\t\t\t\t\tlog.push(\"INFO : More Line\")\n\t\t\t\t\ttxStream.print(\" \")\n\t\t\t\t} else if((prompt && lastLn == prompt) || (enablePrompt && lastLn == enablePrompt)) {\n\t\t\t\t\tdef newPromptIndex = stdout.lastIndexOf(prompt)\n\t\t\t\t\t\n\t\t\t\t\tif(enablePrompt) { // Check if there is a more recent EnablePrompt\n\t\t\t\t\t\tnewPromptIndex = Math.max(newPromptIndex, stdout.lastIndexOf(enablePrompt))\n\t\t\t\t\t}\n\n\t\t\t\t\tif(newPromptIndex != promptIndex || filteredPrompt) {\n\t\t\t\t\t\tlog.push(\"INFO : Prompt Line\")\n\t\t\t\t\t\tpromptIndex = newPromptIndex\n\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.push(\"WARN : Duplicate Prompt Index\")\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdef customFound = false\n\n\t\t\t\t\tcustomLineResponse.each { match, response->\n\t\t\t\t\t\tif(lastLn ==~ match) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Custom Response Line Found - ${lastLn}\")\n\t\t\t\t\t\t\ttxStream.print(response)\n\t\t\t\t\t\t\tcustomFound = true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!customFound) {\n\t\t\t\t\t\tlog.push(\"INFO : Unknown Line - ${lastLn}\")\n\n\t\t\t\t\t\tif(!prompt && !lastLn.isAllWhitespace() && authenticated) {\n\t\t\t\t\t\t\tif(lastLn.length() < promptMaxSize) {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Assuming line is prompt - ${lastLn}\")\n\t\t\t\t\t\t\t\tprompt = lastLn\n\t\t\t\t\t\t\t\tpromptIndex = stdout.lastIndexOf(prompt)\n\t\t\t\t\t\t\t\tisPrompt = true\n\t\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlog.push(\"INFO : Line greater than ${promptMaxSize} characters. Unlikely to be a prompt.\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(isPrompt) { // A prompt is waiting for input. We do our actions here.\n\t\t\t\t\tif(!prompt) { // If we found a prompt with our prompt line cleared, update it\n\t\t\t\t\t\tprompt = enablePrompt\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tif(promptFilter && !promptValidated) {\n\t\t\t\t\t\tif(prompt ==~ /.*\\d+:\\d+:\\d+:.*/) {\n\t\t\t\t\t\t\tlog.push(\"INFO : Prompt contains time\")\n\t\t\t\t\t\t\tprompt = prompt.replaceAll(/(\\d+:\\d+:\\d+[:.]?\\d*)/,\"#\")\n\t\t\t\t\t\t\tlog.push(\"INFO : Time removed from prompt [${prompt}]\")\n\t\t\t\t\t\t\tfilteredPrompt = true\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tpromptChecked = true\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tif(extraLoginCommands) {\n\t\t\t\t\t\tdef command = extraLoginCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Performing Second Login\")\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t\tcredentialCommands = [loginPass]\n\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t} else if(escalationCommands) {\n\t\t\t\t\t\tdef command = escalationCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Sending Escalation command\")\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\n\t\t\t\t\t\tif(command == \"enable\") {\n\t\t\t\t\t\t\tenablePrompt = \"${prompt[0..-2]}#\"\n\t\t\t\t\t\t\tlog.push(\"INFO : Setting enable prompt to - ${enablePrompt}\")\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsleep(1000) // Prompt change unknown. Wait for change.\n\t\t\t\t\t\t\tprompt = \"\"\n\t\t\t\t\t\t\tpromptValidated = false\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcredentialCommands = [enblePass]\n\t\t\t\t\t\tendc.push(\"exit\")\n\t\t\t\t\t} else if(formattingCommands) {\n\t\t\t\t\t\tdef command = formattingCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Sending Formatting command - ${command}\")\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t}else if (collectingCommands) {\n\t\t\t\t\t\tdef command = collectingCommands.pop()\n\t\t\t\t\t\tlog.push(\"INFO : Sending Collecting command - ${command}\")\n\t\t\t\t\t\tlastCollectionIndex = cursor\n\t\t\t\t\t\ttxStream.print(\"${command}\\n\")\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.push(\"INFO : Command output finished\")\n\n\t\t\t\t\t\tdef out = stdout.substring(lastCollectionIndex)\n\n\t\t\t\t\t\tif(ansiMode) {\n\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t .replaceAll(/\\n.*\\e\\[2(J|K)/, \"\\n\")\n\t\t\t\t\t\t\t\t\t .split(/\\n|\\r\\n|\\e\\[(1|2)?(J|K)/)\n\t\t\t\t\t\t\t\t\t .tail() // Remove first (prompt) line\n\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t .replaceAll(ansiEscapeRegex, \"\")\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tout = out.replaceAll(cRgx, \"\")\n\t\t\t\t\t\t\t\t\t .replaceAll(fRgx, \"\")\n\t\t\t\t\t\t\t\t\t .split(\"\\n\")\n\t\t\t\t\t\t\t\t\t .tail()\n\t\t\t\t\t\t\t\t\t .join(\"\\n\")\n\t\t\t\t\t\t\t\t\t .trim()\n\t\t\t\t\t\t\t\t\t .replaceAll(\"(\\\\Q${prompt}\\\\E|\\\\Q${enablePrompt}\\\\E\\\\s*)*\\$\", \"\") // Remove last (prompt) line\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(sRgx && out =~ sRgx) {\n\t\t\t\t\t\t\tout = \"\"\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(out) {\n\t\t\t\t\t\t\tprint out\n\n\t\t\t\t\t\t\tstate = States.SUCCESSFUL\n\t\t\t\t\t\t\tstats[\"size\"] = out.length()\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.push(\"ERROR : Captured output was invalid\")\n\t\t\t\t\t\t\tlog.push(\"--- Command Result ---\")\n\t\t\t\t\t\t\tlog.push(stdout.substring(lastCollectionIndex))\n\t\t\t\t\t\t\tlog.push(\"----------------------\")\n\t\t\t\t\t\t\tstate = States.INVALID\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(System.currentTimeMillis() > readTimeoutEnd && state != States.SUCCESSFUL) { // Timeout\n\t\t\tlog.push(\"ERROR : Timeout looking for valid line\")\n\t\t\tlog.push(\"--- Standard Output ---\")\n\t\t\tlog.push(stdout)\n\t\t\tlog.push(\"-----------------------\")\n\n\t\t\tstate = States.FAILED\n\t\t}\n\n\n\t\tif(System.currentTimeMillis() > startTime + maximumTimeout) { // Timeout\n\t\t\tlog.push(\"ERROR : Maximum timeout reached\")\n\t\t\t\n\t\t\tstate = States.FAILED\n\t\t}\n\n\t\tif(state != States.RUNNING) { // Collection finished. Quit out safely.\n\t\t\tlog.push(\"INFO : Collection finished with ${state} state\")\n\t\t\ttxStream.print(\"\\u0003\") // Send a SIGINT to interupt anything running.\n\t\t\t\n\t\t\tendc.each {\n\t\t\t\ttry {\n\t\t\t\t\tlog.push(\"INFO : Sending End command - ${it}\")\n\t\t\t\t\ttxStream.print(\"${it}\\n\")\n\t\t\t\t} catch (ex) {\n\t\t\t\t\tlog.push(\"WARN : Failed to send - ${it}\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\n\t\tThread.sleep(1)\n\t}\n} catch (e) {\n\tlog.push(\"ERROR : Exception - ${e.message}\")\n} finally {\n\ttry {\n\t\tsocket?.close()\n\t} catch (e) {\n\t\tlog.push(\"ERROR : Exception Closing - ${e.message}\")\n\t}\n\n\tstats[\"time\"] = System.currentTimeMillis()\n\tstats[\"duration\"] = System.currentTimeMillis() - startTime\n\tstats[\"state\"] = state\n\tstats[\"log\"] = log\n\tstats[\"rawSize\"] = stats[\"rawSize\"] ?: stdout.length()\n\n\tif(state != States.SUCCESSFUL) {\n\t\tprintln \"--- Collection Failure Log ---\"\n\t\tprint log.join(\"\\n\")\n\t}\n\n\tdef json = JsonOutput.prettyPrint(JsonOutput.toJson(stats))\n\tfileCache.write(json)\n\n\treturn (state == States.SUCCESSFUL) ? 0 : 1\n}"}, "configChecks": [{"name": "Check", "description": "", "type": "ignore", "attrs": {"ignore": {"ignoreRegex": ["(1[0-9]|2[0-4]):\\d\\d?:\\d\\d:?\\d*.*[>#$]$", "(?i)^\\s*FREE MEMORY:.*", "(?i)^\\s*DAYS TO EXPIRATION", "(?i)^\\s*SET (PASSW(OR)?D)|(PSKSECRET)|(MD5-KEY)|(ENC)", "(?i)^#", "(?i)^.*UP(TIME)?\\s*(IS)?:?\\s*\\d+\\s*(YEAR|WEEK|DAY|HOUR|MINUTE)S?.*", "^!", "(?i)(MON|TUE|WED|THU|FRI|SAT|SUN) (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) \\d+ \\d+:\\d+\\d+:\\d+\\.?\\d* [A-Z]*", "(?i)USING \\d+ OUT OF \\d+ BYTES", "(?i)^SYSTEM RESTARTED AT", "(?i)UP\\s?TIME", "(?i)^CURRENT CONFIGURATION\\s*:", "(?i)^NTP CLOCK-PERIOD"], "ignoreContain": [], "ignoreStart": [], "ignoreSpaces": false, "ignoreBlank": true}, "clearAfterAck": true, "clearAfterMin": 0}, "severity": "warn"}], "fileFormat": "arbitrary"}

×DataSource: Microsoft_Azure_Databrick_AppExecutor (64)

{"name": "Microsoft_Azure_Databrick_AppExecutor", "description": "Discover a resource such as: \"clusterName app-id.id\"", "appliesTo": "hasCategory(\"Azure/Databricks\")", "searchKeywords": "databrick,microsoft,log analytics workspaces,azure", "technicalNotes": "https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.OperationalInsights%2Fworkspaces\nhttps://docs.microsoft.com/en-us/azure/architecture/databricks-monitoring/application-logs", "displayedAs": "Microsoft Azure Databrick App Executor", "collectionInterval": "3m", "collectionMethod": "azureloganalyticsworkspaces", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_azureloganalyticsworkspaces", "discoveryInterval": "60m", "deleteInactiveInstances": true, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"logAnalyticsWorkspacesQuery": "let period = 10d;\nSparkMetric_CL\n| where TimeGenerated > ago(period) and isnotempty( applicationId_s) and nodeType_s == 'executor'\n| distinct applicationId_s, clusterName_s, executorId_s\n| extend instanceName = strcat(clusterName_s, \" \", applicationId_s, \".\", executorId_s )\n| sort by instanceName asc", "logAnalyticsWorkspacesColumnInstanceName": "instanceName"}, "groupMethod": "ilp", "groupExpr": "auto.azure.clustername_s"}, "collectionAttrs": {"logAnalyticsWorkspacesQuery": "let period = ${PERIOD_TIME};\nlet instance_name = ${auto.azure.instancename};\nSparkMetric_CL\n| where TimeGenerated > ago(period) and nodeType_s == 'executor'\n and isnotempty(applicationId_s)\n and strcat(clusterName_s, \" \",applicationId_s,\".\",executorId_s) == instance_name\n| extend data_point = replace_string(name_s, strcat(applicationId_s, '.', executorId_s,'.'), '')"}, "datapoints": [{"name": "appExecutorCpuTime", "description": "app executor CPU Time", "interpretMethod": "none", "interpretExpr": "{\"dataPointDefinitionColumn\":\"data_point\",\"dataPointName\":\"executor.cpuTime\",\"dataPointValueColumn\":\"count_d\",\"aggregation\":\"avg\"}", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "appJvmCpuTime", "description": "app JVMCPU jvmCpuTime", "interpretMethod": "none", "interpretExpr": "{\"dataPointDefinitionColumn\":\"data_point\",\"dataPointName\":\"JVMCPU.jvmCpuTime\",\"dataPointValueColumn\":\"value_d\",\"aggregation\":\"avg\"}", "useValue": "rawData", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "app JVM Cpu Time", "title": "app JVM Cpu Time", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "appJvmCpuTime", "datapointName": "appJvmCpuTime", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "appJvmCpuTimeSec", "expr": "appJvmCpuTime/1000000000"}], "lines": [{"type": "line", "legend": "appJvmCpuTimeSec", "color": "silver", "datapointName": "appJvmCpuTimeSec", "isVirtual": true}]}, {"name": "app executor cpuTime", "title": "app executor cpuTime", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "appExecutorCpuTime", "datapointName": "appExecutorCpuTime", "consolidationFn": "average"}], "virtualDatapoints": [{"name": "appExecutorCpuTimeSec", "expr": "appExecutorCpuTime/1000000000"}], "lines": [{"type": "line", "legend": "appExecutorCpuTimeSec", "color": "blue", "datapointName": "appExecutorCpuTimeSec", "isVirtual": true}]}]}

×DataSource: Kubernetes_KSM_Cronjobs (55)

{"name": "Kubernetes_KSM_Cronjobs", "description": "Monitors kubernetes cronjobs via KSM", "appliesTo": "hasCategory(\"KubernetesCronJob\") && hasCategory(\"KubernetesKSM\")", "searchKeywords": "kube-state-metrics,kubernetes,ksm,k8s,cronjob", "displayedAs": "Kubernetes Cronjob", "collectionInterval": "1m", "collectionMethod": "openmetrics", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"url": "##auto.ksm.service.url##", "connectTimeoutMs": 2000, "readTimeoutMs": 10000, "followRedirect": false}, "datapoints": [{"name": "age", "description": "Cronjob age in seconds", "config": {}, "interpretMethod": "expression", "interpretExpr": "now()-kubeCronjobCreated", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ageDays", "description": "Cronjob age in days", "config": {}, "interpretMethod": "expression", "interpretExpr": "age/86400", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "delay", "description": "Delay in cronjob scheduling.", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(gt((now()-kubeCronjobNextScheduleTime),kubeCronjobSpecStartingDeadlineSeconds),1,0)", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 5, "alertBody": "The host ##HOSTNAME## is reporting ##VALUE## value which means Cronjob is delayed, hence raised ##LEVEL## alert.\nThis started at ##START## - or ##DURATION## ago."}, {"name": "kubeCronjobActiveJobs", "description": "Active holds pointers to currently running jobs.", "config": {"metricName": "kube_cronjob_status_active", "instanceLabel": "namespace=\"##auto.namespace##\",cronjob=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",cronjob=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeCronjobCreated", "description": "Unix creation timestamp.", "config": {"metricName": "kube_cronjob_created", "instanceLabel": "namespace=\"##auto.namespace##\",cronjob=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",cronjob=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeCronjobNextScheduleTime", "description": "Next time the cronjob should be scheduled. The time after lastScheduleTime, or after the cron job's creation time if it's never been scheduled. Use this to determine if the job is delayed.", "config": {"metricName": "kube_cronjob_next_schedule_time", "instanceLabel": "namespace=\"##auto.namespace##\",cronjob=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",cronjob=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeCronjobSpecStartingDeadlineSeconds", "description": "Deadline in seconds for starting the job if it misses scheduled time for any reason.", "config": {"metricName": "kube_cronjob_spec_starting_deadline_seconds", "instanceLabel": "namespace=\"##auto.namespace##\",cronjob=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",cronjob=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Age", "title": "Age", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ageDays", "datapointName": "ageDays", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "ageDays", "color": "silver", "datapointName": "ageDays", "isVirtual": false}]}, {"name": "Status", "title": "Status", "verticalLabel": "0=completed,1=active", "min": -1.0, "max": 1.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeCronjobStatusActive", "datapointName": "kubeCronjobActiveJobs", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "kubeCronjobStatusActive", "color": "silver", "datapointName": "kubeCronjobStatusActive", "isVirtual": false}]}]}

×DataSource: Kubernetes_KSM_Jobs (54)

{"name": "Kubernetes_KSM_Jobs", "description": "Monitors kubernetes jobs via KSM", "appliesTo": "hasCategory(\"KubernetesJob\") && \nhasCategory(\"KubernetesKSM\")", "searchKeywords": "kube-state-metrics,kubernetes,ksm,k8s,job", "displayedAs": "Kubernetes Job", "collectionInterval": "1m", "collectionMethod": "openmetrics", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"url": "##auto.ksm.service.url##", "connectTimeoutMs": 2000, "readTimeoutMs": 10000, "followRedirect": false}, "datapoints": [{"name": "age", "description": "Job age in seconds", "config": {}, "interpretMethod": "expression", "interpretExpr": "now()-kubeJobCreated", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ageDays", "description": "Job age in days", "config": {}, "interpretMethod": "expression", "interpretExpr": "age/86400", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "jobCompletionPhase", "description": "Status code that returns execution status of Jobs.\n\nStatus Codes:\n0=False\n1=True\n2=Unknown", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(gt(kubeJobCompleteFalse,0),0,(if(gt(kubeJobCompleteTrue,0),1,(if(gt(kubeJobCompleteUnknown,0),2,2)))))", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeJobCompleteFalse", "description": "The job has completed its execution.", "config": {"metricName": "kube_job_complete", "instanceLabel": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\",condition=\"false\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\",condition=\"false\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeJobCompleteTrue", "description": "The job has completed its execution.", "config": {"metricName": "kube_job_complete", "instanceLabel": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\",condition=\"true\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\",condition=\"true\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeJobCompleteUnknown", "description": "The job has completed its execution.", "config": {"metricName": "kube_job_complete", "instanceLabel": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\",condition=\"unknown\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\",condition=\"unknown\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "max": "2", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeJobCreated", "description": "Unix creation timestamp", "config": {"metricName": "kube_job_created", "instanceLabel": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeJobSpecCompletions", "description": "The desired number of successfully finished pods the job should be run with.", "config": {"metricName": "kube_job_spec_completions", "instanceLabel": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeJobSpecParallelism", "description": "The maximum desired number of pods the job should run at any given time.", "config": {"metricName": "kube_job_spec_parallelism", "instanceLabel": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeJobStatusActive", "description": "The number of actively running pods.", "config": {"metricName": "kube_job_status_active", "instanceLabel": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "max": "3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeJobStatusFailed", "description": "The number of pods which reached Phase Failed and the reason for failure.", "config": {"metricName": "kube_job_status_failed", "instanceLabel": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\"", "aggregateMethod": "sum"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 5, "alertSubject": "Job has failed", "alertBody": "The Kubernetes Job ##INSTANCE## has ##VALUE## pods which are failing, placing the ##HOST## device into ##LEVEL## state.\n\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "kubeJobStatusSucceeded", "description": "The number of pods which reached Phase Succeeded.", "config": {"metricName": "kube_job_status_succeeded", "instanceLabel": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",job_name=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "min": "0", "max": "3", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "runningJobStatus", "description": "Status code that returns status of Jobs.\n\nStatus Codes:\n1=Succeeded\n2=Active\n3=Failed", "config": {}, "interpretMethod": "expression", "interpretExpr": "if(gt(kubeJobStatusSucceeded,0),1,(if(gt(kubeJobStatusActive,0),2,(if(gt(kubeJobStatusFailed,0),3,4)))))", "type": "gauge", "dataType": 7, "min": "1", "max": "4", "threshold": ">= 3", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 5, "alertBody": "The host ##HOSTNAME## is reporting ##VALUE## value which means Job is failed, hence raised ##LEVEL## alert.\nThis started at ##START## - or ##DURATION## ago."}], "graphs": [{"name": "Age", "title": "Age", "verticalLabel": "days", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ageDays", "datapointName": "ageDays", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "ageDays", "color": "silver", "datapointName": "ageDays", "isVirtual": false}]}, {"name": "Completed Job Pods", "title": "Completed Job Pods", "verticalLabel": "count", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeJobSpecCompletions", "datapointName": "kubeJobSpecCompletions", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "kubeJobSpecCompletions", "color": "silver", "datapointName": "kubeJobSpecCompletions", "isVirtual": false}]}, {"name": "Job Completion Phase", "title": "Job Completion Phase", "verticalLabel": "0=false,1=true,2=unknown", "min": 0.0, "max": 3.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeJobExecutionPhase", "datapointName": "jobCompletionPhase", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "kubeJobExecutionPhase", "color": "silver", "datapointName": "kubeJobExecutionPhase", "isVirtual": false}]}, {"name": "Parallel Running Job Pods", "title": "Parallel Running Job Pods", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "KubeJobSpecParallelism", "datapointName": "kubeJobSpecParallelism", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "KubeJobSpecParallelism", "color": "silver", "datapointName": "KubeJobSpecParallelism", "isVirtual": false}]}, {"name": "Running Job Status", "title": "Running Job Status", "verticalLabel": "1=succeeded,2=active,3=failed", "min": 0.0, "max": 4.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "jobStatus", "datapointName": "runningJobStatus", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "jobStatus", "color": "silver", "datapointName": "jobStatus", "isVirtual": false}]}]}

×DataSource: Kubernetes_KSM_Nodes (2481805)

{"name": "Kubernetes_KSM_Nodes", "description": "Monitors the performance of compute resources.", "appliesTo": "hasCategory(\"KubernetesNode\")", "searchKeywords": "kubernetes,node,container orchestration", "technicalNotes": "See https://github.com/logicmonitor/k8s-argus and\nhttps://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", "displayedAs": "Kubernetes Node (KSM)", "collectionInterval": "2m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.http.Client\nimport com.santaba.agent.groovyapi.http.SSLClient\nimport org.apache.http.params.HttpConnectionParams\nimport java.lang.reflect.Field\nimport com.santaba.agent.groovyapi.http.HTTP\nimport groovy.json.JsonSlurper\n\ndef nodeLabel = hostProps.get(\"auto.name\")\n\nMap k8s_info = getKubernetesProperties( hostProps)\n\nMap conditionMap = [\"false\" : 0, \"true\" : 1, \"unknown\" : 2]\n\nList targetMetrics = [\n \"kube_node_annotations\",\n \"kube_node_info\",\n \"kube_node_labels\",\n \"kube_node_role\",\n \"kube_node_spec_unschedulable\",\n \"kube_node_created\"\n]\n\n// Collector Cache\ncollectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n\ndef payload = collectorCache.get(makeKey(\"data\", \"payload\"))\n\n// def internalIp = \"\"\ndef kubeletPort = 10255\ndef secure_port = 10250\ndef use_ssl = true\ndef ksmMetricsKey = \"ksmMetricsAvailable\"\ndef summaryMetricsKey = \"summaryMetricsAvailable\"\n\ntry {\n print getNodeMetrics(k8s_info, secure_port, use_ssl)\n println \"${summaryMetricsKey}=1\"\n} catch(ConnectException e) {\n print getNodeMetrics(k8s_info, insecure_port, !use_ssl)\n println \"${summaryMetricsKey}=1\"\n} catch(Exception e) {\n e.printStackTrace()\n println \"${summaryMetricsKey}=0\"\n}\n\nif (payload) {\n List metrics = openmetricsParse(payload)\n\n def nodeMetrics = metrics.findAll { metricData -> metricData.labels.node == nodeLabel }\n\n if (nodeMetrics) {\n println \"${ksmMetricsKey}=1\"\n }\n \n // findResourceValues(nodeMetrics, \"kube_node_info\").each{\n // internalIp = it.labels.internal_ip\n // }\n\n findResourceValues(nodeMetrics, \"kube_node_status_allocatable\").each{\n println \"kube_node_status_allocatable_${it.labels.resource}=${it.value}\"\n }\n\n findResourceValues(nodeMetrics, \"kube_node_status_capacity\").each{\n println \"kube_node_status_capacity_${it.labels.resource}=${it.value}\"\n }\n\n def conditions = findCondition(nodeMetrics, \"kube_node_status_condition\")\n conditions?.each {\n println \"kube_node_status_condition_${it.labels.condition}=${conditionMap[it?.labels?.status]}\"\n }\n\n def taints = findResourceValues(nodeMetrics, \"kube_node_spec_taint\")\n println \"kube_node_spec_taint=${taints.size()}\"\n\n targetMetrics.each { targetMetric ->\n nodeMetrics.findAll { metricData -> targetMetric == metricData?.name }.each {\n println \"${it?.name}=${it?.value}\"\n }\n }\n\n} else {\n println \"Could not find a cached payload\"\n println \"${ksmMetricsKey}=0\"\n return 1\n}\n\nreturn 0\n\nstatic String makeKey( String facility, String attributeName) {\n return \"KubernetesKSM:${facility}.${attributeName}\"\n}\n\nstatic List findResourceValues(List metrics, String identifier){\n def allMatches = metrics.findAll{ it.name == identifier }\n return allMatches\n}\n\nstatic List findCondition(List metrics, String identifier){\n def trueValue = metrics.findAll { it.name == identifier && it.value == \"1\"}\n return trueValue\n}\n\ndef getNodeMetrics(k8s_info, port, use_ssl) {\n\n def metrics_endpoint = \"/api/v1/nodes/\" + k8s_info.k8s_name + \"/proxy/stats/summary\"\n long startTime = System.currentTimeMillis(); \n def response = queryAPI( metrics_endpoint, k8s_info )\n \n def output = \"\"\n\n def node = response?.node\n\n if (node) {\n if (node.cpu) {\n output += \"cpu_usageNanoCores=${node.cpu.usageNanoCores}\\n\"\n output += \"cpu_usageCoreNanoSeconds=${node.cpu.usageCoreNanoSeconds}\\n\"\n }\n if (node.fs) {\n output += \"fs_availableBytes=${node.fs.availableBytes}\\n\"\n output += \"fs_capacityBytes=${node.fs.capacityBytes}\\n\"\n output += \"fs_usedBytes=${node.fs.usedBytes}\\n\"\n output += \"fs_inodesFree=${node.fs.inodesFree}\\n\"\n output += \"fs_inodes=${node.fs.inodes}\\n\"\n output += \"fs_inodesUsed=${node.fs.inodesUsed}\\n\"\n }\n if (node.memory) {\n output += \"memory_availableBytes=${node.memory.availableBytes}\\n\"\n output += \"memory_usageBytes=${node.memory.usageBytes}\\n\"\n output += \"memory_workingSetBytes=${node.memory.workingSetBytes}\\n\"\n output += \"memory_rssBytes=${node.memory.rssBytes}\\n\"\n output += \"memory_pageFaults=${node.memory.pageFaults}\\n\"\n output += \"memory_majorPageFaults=${node.memory.majorPageFaults}\\n\"\n }\n if (node.network) {\n output += \"network_rxBytes=${node.network.rxBytes}\\n\"\n output += \"network_rxErrors=${node.network.rxErrors}\\n\"\n output += \"network_txBytes=${node.network.txBytes}\\n\"\n output += \"network_txErrors=${node.network.txErrors}\\n\"\n }\n }\n\n println \"Total time for collecting node metrics: \" + (System.currentTimeMillis() - startTime)\n return output\n}\n\ndef queryAPI( String api_endpoint, k8s_info ) {\n def http = HTTP.open(k8s_info.k8s_service_host, k8s_info.k8s_service_port, k8s_info.k8s_service_ssl )\n def request_headers = [ \"Authorization\" : \"Bearer ${k8s_info.k8s_serviceaccount_token}\" ]\n\n if (http instanceof SSLClient) {\n SSLClient s = (SSLClient)http\n Field f = Client.class.getDeclaredField(\"_client\")\n f.setAccessible(true)\n HttpConnectionParams.setConnectionTimeout(f.get(s).getParams(), 1000 * 15)\n HttpConnectionParams.setSoTimeout(f.get(s).getParams(), 1000 * 15)\n }\n http.get(api_endpoint, request_headers)\n\n def result = {}\n println \"nodeAccessCode=${http.statusCode}\"\n if ( http.statusCode == 200 ) {\n result = new JsonSlurper().parseText(http.getResponseBody())\n }\n http.close()\n \n return result\n}\n\ndef getKubernetesProperties( parent_hostProps ) {\n def k8s_namespace = parent_hostProps?.get(\"auto.namespace\")\n def k8s_name = parent_hostProps?.get(\"auto.name\")\n def k8s_nodename = parent_hostProps?.get(\"auto.nodename\")\n def k8s_pod = parent_hostProps?.get(\"auto.pod\")\n def k8s_selflink = parent_hostProps?.get(\"auto.selflink\")\n def k8s_ssl = parent_hostProps?.get(\"auto.kubernetes.label.ssl\") ? parent_hostProps?.get(\"auto.kubernetes.label.ssl\") : true\n\n def env = System.getenv()\n def k8s_service_host = env[\"KUBERNETES_SERVICE_HOST\"]\n def k8s_service_port = env.get(\"KUBERNETES_SERVICE_PORT\")?.toInteger()?:443\n\n def k8s_service_ssl = (k8s_service_port == 443)\n if ( k8s_ssl ) { k8s_service_ssl = k8s_ssl }\n\n def k8s_serviceaccount_token = new File('/var/run/secrets/kubernetes.io/serviceaccount/token').text\n def request_headers = [\"Authorization\" : \"Bearer ${k8s_serviceaccount_token}\"]\n\n return [\n k8s_namespace: k8s_namespace,\n k8s_name: k8s_name,\n k8s_nodename: k8s_nodename,\n k8s_pod: k8s_pod,\n k8s_serviceaccount_token: k8s_serviceaccount_token,\n k8s_selflink: k8s_selflink,\n k8s_service_host: k8s_service_host,\n k8s_service_port: k8s_service_port,\n k8s_service_ssl: k8s_service_ssl\n ]\n}\n\n// Parse scraped openmetrics payload into a list of maps.\nList openmetricsParse(body) {\n def metricTypes = [:]\n def metricHelp = [:]\n def metrics = []\n\n // Iterate through the metric page, parse and print out metrics\n List METRIC_SUFIXES = [\"_sum\", \"_bucket\", \"_count\", ]\n\n body.eachLine { line ->\n if (line.trim() == \"\") return // Completely ignore empty lines\n def splitLine = line.tokenize(\" \")\n splitLine = line.toString().split(\"\\\\s+(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*\\$)\")\n if (line.startsWith(\"#\")) {\n if (line.startsWith(\"# HELP\") || line.startsWith(\"# TYPE\")) {\n\n def directiveType = splitLine[1]\n def metricName = splitLine[2]\n\n if (directiveType == \"HELP\") {\n metricHelp[metricName] = line[line.indexOf(metricName) + metricName.size()..-1]\n }\n\n if (directiveType == \"TYPE\") {\n metricTypes[metricName] = splitLine[3]\n }\n }\n }\n else {\n if(splitLine.size() < 2) {\n println(\"ERROR: Invalid line: ${line}\")\n return\n }\n\n def metricDef = splitLine[0]\n def metricLabels = [:]\n def metricName = metricDef\n def metricValue\n def sampleType = \"\"\n\n if(metricDef.contains(\"{\")){\n metricName = metricDef.tokenize(\"{\")[0]\n String labelPayload = metricDef[metricDef.indexOf(\"{\")+1..metricDef.lastIndexOf(\"}\")-1]\n labelPayload.split(/(,)(?=(?:[^\"]|\"[^\"]*\")*$)/).each {\n it = it.trim()\n String labelKey = it.tokenize(\"=\")[0]\n String labelValue = it[labelKey.size()+2..-2]\n metricLabels[labelKey] = labelValue\n }\n }\n\n for (String suffix : METRIC_SUFIXES) {\n if (metricName.endsWith(suffix)) {\n sampleType = suffix\n metricName = metricName.substring(0, metricName.size() - suffix.size())\n }\n }\n\n metricValue = splitLine[1]\n def metric = [\"name\": metricName,\n \"labels\": metricLabels,\n \"sampleType\": sampleType,\n \"value\": metricValue,\n \"type\": metricTypes.get(metricName, \"untyped\")]\n\n if (splitLine.size() == 3) {\n def metricTimestamp = splitLine[3]\n metric[\"timestamp\"] = metricTimestamp\n }\n metrics << metric\n }\n }\n return metrics\n}"}, "datapoints": [{"name": "cpuNanoCoreCapacity", "description": "CPU Capacity of Node in NanoCores", "interpretMethod": "expression", "interpretExpr": "kubeNodeStatusCapacityCpu*1000000000", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpuUsageCoreMilliSeconds", "description": "Cumulative CPU usage (sum of all cores) since object creation in milliCores.", "interpretMethod": "expression", "interpretExpr": "cpuUsageCoreNanoSeconds/1000000", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpuUsageCoreNanoSeconds", "description": "Cumulative CPU usage (sum of all cores) since object creation.", "interpretMethod": "namevalue", "interpretExpr": "cpu_usageCoreNanoSeconds", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpuUsageNanoCores", "description": "Total CPU usage (sum of all cores) averaged over the sample window. The \"core\" unit can be interpreted as CPU core-nanoseconds per second.", "interpretMethod": "namevalue", "interpretExpr": "cpu_usageNanoCores", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpuUsagePercentage", "description": "Percentage of CPU used.", "interpretMethod": "expression", "interpretExpr": "(cpuUsageNanoCores*100)/cpuNanoCoreCapacity", "type": "gauge", "dataType": 7, "min": "0", "max": "100", "threshold": ">= 80 90 100", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 5, "alertSubject": "High CPU Usage on Node", "alertBody": "K8s node ##HOSTNAME## has a high CPU usage of ##VALUE##% which can affect workload scheduling. Hence ##HOST## has raised ##LEVEL## alert.\n\n\nThis started at ##START##, or ##DURATION## ago."}, {"name": "fsAvailableBytes", "description": "AvailableBytes represents the storage space available (bytes) for the filesystem.", "interpretMethod": "namevalue", "interpretExpr": "fs_availableBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "fsCapacityBytes", "description": "CapacityBytes represents the total capacity (bytes) of the filesystems underlying storage.", "interpretMethod": "namevalue", "interpretExpr": "fs_capacityBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "fsInodes", "description": "Inodes represents the total inodes in the filesystem.", "interpretMethod": "namevalue", "interpretExpr": "fs_inodes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "fsInodesFree", "description": "InodesFree represents the free inodes in the filesystem.", "interpretMethod": "namevalue", "interpretExpr": "fs_inodesFree", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "fsInodesUsed", "description": "InodesUsed represents the inodes used by the filesystem. This may not equal Inodes - InodesFree because this filesystem may share inodes with other \"filesystems\".\ne.g. For ContainerStats.Rootfs, this is the inodes used only by that container, and does not count inodes used by other containers.", "interpretMethod": "namevalue", "interpretExpr": "fs_inodesUsed", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "fsUsedBytes", "description": "UsedBytes represents the bytes used for a specific task on the filesystem.", "interpretMethod": "namevalue", "interpretExpr": "fs_usedBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ksmMetricsAvailable", "description": "Availability of KSM Metrics from Watchdog\n0 - Not Available\n1 - Available", "interpretMethod": "namevalue", "interpretExpr": "ksmMetricsAvailable", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeNodeCreated", "description": "The amount of memory the node is restricted to provide.", "interpretMethod": "namevalue", "interpretExpr": "kube_node_created", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeNodeSpecTaint", "description": "The total amount of pods that could be allocated on the node.", "interpretMethod": "namevalue", "interpretExpr": "kube_node_spec_taint", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeNodeSpecUnschedulable", "description": "The total amount of memory resources that the node could provide.", "interpretMethod": "namevalue", "interpretExpr": "kube_node_spec_unschedulable", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeNodeStatusAllocatableCpu", "description": "The number of compute resources ( nano-cores ) that have been requested.", "interpretMethod": "namevalue", "interpretExpr": "kube_node_status_allocatable_cpu", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeNodeStatusAllocatableEphemeralStorage", "description": "The number of compute resources ( nano-cores ) that have been requested.", "interpretMethod": "namevalue", "interpretExpr": "kube_node_status_allocatable_ephemeral_storage", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeNodeStatusAllocatableMemory", "description": "The number of compute resources ( nano-cores ) that have been requested.", "interpretMethod": "namevalue", "interpretExpr": "kube_node_status_allocatable_memory", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeNodeStatusAllocatablePods", "description": "The number of compute resources ( nano-cores ) that have been requested.", "interpretMethod": "namevalue", "interpretExpr": "kube_node_status_allocatable_pods", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeNodeStatusCapacityCpu", "description": "The amount of compute resources the node is restricted to provide.", "interpretMethod": "namevalue", "interpretExpr": "kube_node_status_capacity_cpu", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeNodeStatusCapacityEphemeralStorage", "description": "The amount of compute resources the node is restricted to provide.", "interpretMethod": "namevalue", "interpretExpr": "kube_node_status_capacity_ephemeral_storage", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeNodeStatusCapacityMemory", "description": "The amount of compute resources the node is restricted to provide.", "interpretMethod": "namevalue", "interpretExpr": "kube_node_status_capacity_memory", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeNodeStatusCapacityPods", "description": "The amount of compute resources the node is restricted to provide.", "interpretMethod": "namevalue", "interpretExpr": "kube_node_status_capacity_pods", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubeNodeStatusConditionDiskPressure", "description": "Demand on disk I/O.\n\nStatus codes:\n0 = OK\n1 = Not OK", "interpretMethod": "namevalue", "interpretExpr": "kube_node_status_condition_DiskPressure", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "Kubernetes Node Reporting Excessive Disk Pressure", "alertBody": "K8s node ##HOSTNAME## is reporting disk pressure issues (status code ##VALUE##) which is affecting workload scheduling. Hence ##HOST## has raised ##LEVEL## alert.\n\nStatus codes:\n0 = OK\n1 = Not OK\n\nThis started at ##START##, or ##DURATION## ago."}, {"name": "kubeNodeStatusConditionMemoryPressure", "description": "Demand on disk I/O.\n\nStatus codes:\n0 = OK\n1 = Not OK", "interpretMethod": "namevalue", "interpretExpr": "kube_node_status_condition_MemoryPressure", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "Kubernetes Node Reporting Excessive Disk Pressure", "alertBody": "K8s node ##HOSTNAME## is reporting memory pressure issues (status code ##VALUE##) which is affecting workload scheduling. Hence ##HOST## has raised ##LEVEL## alert.\n\nStatus codes:\n0 = OK\n1 = Not OK\n\nThis started at ##START##, or ##DURATION## ago."}, {"name": "kubeNodeStatusConditionPIDPressure", "description": "Demand on disk I/O.\n\nStatus codes:\n0 = OK\n1 = Not OK", "interpretMethod": "namevalue", "interpretExpr": "kube_node_status_condition_PIDPressure", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "!= 0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "Kubernetes Node Reporting Excessive Disk Pressure", "alertBody": "K8s node ##HOSTNAME## is reporting PID pressure issues (status code ##VALUE##) which is affecting workload scheduling. Hence ##HOST## has raised ##LEVEL## alert.\n\nStatus codes:\n0 = OK\n1 = Not OK\n\nThis started at ##START##, or ##DURATION## ago."}, {"name": "kubeNodeStatusConditionReady", "description": "Demand on disk I/O.\n\nStatus codes:\n1 = OK\n0 = Not OK", "interpretMethod": "namevalue", "interpretExpr": "kube_node_status_condition_Ready", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "!= 1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "Kubernetes Node Reporting Excessive Disk Pressure", "alertBody": "K8s node ##HOSTNAME## is not reporting ready condition (status code ##VALUE##) which is affecting workload scheduling. Hence ##HOST## has raised ##LEVEL## alert.\n\nStatus codes:\n0 = OK\n1 = Not OK\n\nThis started at ##START##, or ##DURATION## ago."}, {"name": "memoryAvailableBytes", "description": "Available memory for use in bytes. This is defined as the memory limit - workingSetBytes.", "interpretMethod": "namevalue", "interpretExpr": "memory_availableBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryMajorPageFaults", "description": "Cumulative number of major page faults.", "interpretMethod": "namevalue", "interpretExpr": "memory_majorPageFaults", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryPageFaults", "description": "Cumulative number of minor page faults.", "interpretMethod": "namevalue", "interpretExpr": "memory_pageFaults", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryRssBytes", "description": "The amount of anonymous and swap cache memory (includes transparent hugepages).", "interpretMethod": "namevalue", "interpretExpr": "memory_rssBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryUsageBytes", "description": "Total memory in use. This includes all memory regardless of when it was accessed.", "interpretMethod": "namevalue", "interpretExpr": "memory_usageBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryWorkingSetBytes", "description": "The amount of working set memory. This includes recently accessed memory, dirty memory, and kernel memory.", "interpretMethod": "namevalue", "interpretExpr": "memory_workingSetBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "networkRxBytes", "description": "Cumulative count of bytes received.", "interpretMethod": "namevalue", "interpretExpr": "network_rxBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "networkRxErrors", "description": "Cumulative count of receive errors encountered.", "interpretMethod": "namevalue", "interpretExpr": "network_rxErrors", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "networkTxBytes", "description": "Cumulative count of bytes transmitted.", "interpretMethod": "namevalue", "interpretExpr": "network_txBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "networkTxErrors", "description": "Cumulative count of transmit errors encountered.", "interpretMethod": "namevalue", "interpretExpr": "network_txErrors", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "nodeUptime", "description": "Time in seconds since the node is in start state.", "interpretMethod": "expression", "interpretExpr": "now()-kubeNodeCreated", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "nodeUptimeDays", "description": "Time in seconds since the node is in start state.", "interpretMethod": "expression", "interpretExpr": "nodeUptime/86400", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "summaryMetricsAvailable", "description": "Availability of Node Metrics from Summary API\n0 - Not Available\n1 - Available", "interpretMethod": "namevalue", "interpretExpr": "summaryMetricsAvailable", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "CPU Capacity", "title": "CPU Capacity", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "kubeNodeStatusAllocatableCpu", "datapointName": "kubeNodeStatusAllocatableCpu", "consolidationFn": "average"}, {"name": "kubeNodeStatusCapacityCpu", "datapointName": "kubeNodeStatusCapacityCpu", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "kubeNodeStatusAllocatableCpu", "color": "silver", "datapointName": "kubeNodeStatusAllocatableCpu", "isVirtual": false}, {"type": "line", "legend": "kubeNodeStatusCapacityCpu", "color": "lime", "datapointName": "kubeNodeStatusCapacityCpu", "isVirtual": false}]}, {"name": "CPU Usage %", "title": "CPU Usage %", "verticalLabel": "%", "min": 0.0, "max": 99.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cpuUsagePercentage", "datapointName": "cpuUsagePercentage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "cpuUsagePercentage", "color": "silver", "datapointName": "cpuUsagePercentage", "isVirtual": false}]}, {"name": "CPU Usage Core Milli Seconds", "title": "CPU Usage Core Milli Seconds", "verticalLabel": "count", "min": 0.0, "displayPriority": 14, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cpuUsageCoreMilliSeconds", "datapointName": "cpuUsageCoreMilliSeconds", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "cpuUsageCoreMilliSeconds", "color": "red2", "datapointName": "cpuUsageCoreMilliSeconds", "isVirtual": false}]}, {"name": "CPU Usage Nano Cores", "title": "CPU Usage Nano Cores", "verticalLabel": "count", "min": 0.0, "displayPriority": 12, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cpuNanoCoreCapacity", "datapointName": "cpuNanoCoreCapacity", "consolidationFn": "average"}, {"name": "cpuUsageNanoCores", "datapointName": "cpuUsageNanoCores", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "cpuNanoCoreCapacity", "color": "red", "datapointName": "cpuNanoCoreCapacity", "isVirtual": false}, {"type": "area", "legend": "cpuUsageNanoCores", "color": "silver", "datapointName": "cpuUsageNanoCores", "isVirtual": false}]}, {"name": "Conditions", "title": "Conditions", "verticalLabel": "count", "min": -1.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeNodeStatusConditionDiskPressure", "datapointName": "kubeNodeStatusConditionDiskPressure", "consolidationFn": "average"}, {"name": "kubeNodeStatusConditionMemoryPressure", "datapointName": "kubeNodeStatusConditionMemoryPressure", "consolidationFn": "average"}, {"name": "kubeNodeStatusConditionPIDPressure", "datapointName": "kubeNodeStatusConditionPIDPressure", "consolidationFn": "average"}, {"name": "kubeNodeStatusConditionReady", "datapointName": "kubeNodeStatusConditionReady", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "kubeNodeStatusConditionDiskPressure", "color": "silver", "datapointName": "kubeNodeStatusConditionDiskPressure", "isVirtual": false}, {"type": "line", "legend": "kubeNodeStatusConditionMemoryPressure", "color": "aqua", "datapointName": "kubeNodeStatusConditionMemoryPressure", "isVirtual": false}, {"type": "line", "legend": "kubeNodeStatusConditionPIDPressure", "color": "olive", "datapointName": "kubeNodeStatusConditionPIDPressure", "isVirtual": false}, {"type": "line", "legend": "kubeNodeStatusConditionReady", "color": "green", "datapointName": "kubeNodeStatusConditionReady", "isVirtual": false}]}, {"name": "Ephemeral Storage Capacity", "title": "Ephemeral Storage Capacity", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 25, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "kubeNodeStatusAllocatableEphemeralStorage", "datapointName": "kubeNodeStatusAllocatableEphemeralStorage", "consolidationFn": "average"}, {"name": "kubeNodeStatusCapacityEphemeralStorage", "datapointName": "kubeNodeStatusCapacityEphemeralStorage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "kubeNodeStatusAllocatableEphemeralStorage", "color": "lime", "datapointName": "kubeNodeStatusAllocatableEphemeralStorage", "isVirtual": false}, {"type": "line", "legend": "kubeNodeStatusCapacityEphemeralStorage", "color": "silver", "datapointName": "kubeNodeStatusCapacityEphemeralStorage", "isVirtual": false}]}, {"name": "Memory", "title": "Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "kubeNodeStatusAllocatableMemory", "datapointName": "kubeNodeStatusAllocatableMemory", "consolidationFn": "max"}, {"name": "kubeNodeStatusCapacityMemory", "datapointName": "kubeNodeStatusCapacityMemory", "consolidationFn": "average"}, {"name": "memoryRssBytes", "datapointName": "memoryRssBytes", "consolidationFn": "max"}, {"name": "memoryUsageBytes", "datapointName": "memoryUsageBytes", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "kubeNodeStatusAllocatableMemory", "color": "orange2", "datapointName": "kubeNodeStatusAllocatableMemory", "isVirtual": false}, {"type": "line", "legend": "kubeNodeStatusCapacityMemory", "color": "red", "datapointName": "kubeNodeStatusCapacityMemory", "isVirtual": false}, {"type": "area", "legend": "memoryRssBytes", "color": "silver", "datapointName": "memoryRssBytes", "isVirtual": false}, {"type": "area", "legend": "memoryUsageBytes", "color": "lime", "datapointName": "memoryUsageBytes", "isVirtual": false}]}, {"name": "Memory Available", "title": "Memory Available", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "memoryAvailableBytes", "datapointName": "memoryAvailableBytes", "consolidationFn": "average"}, {"name": "memoryWorkingSetBytes", "datapointName": "memoryWorkingSetBytes", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "memoryAvailableBytes", "color": "teal", "datapointName": "memoryAvailableBytes", "isVirtual": false}, {"type": "area", "legend": "memoryWorkingSetBytes", "color": "lime", "datapointName": "memoryWorkingSetBytes", "isVirtual": false}]}, {"name": "Memory Capacity", "title": "Memory Capacity", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "kubeNodeStatusAllocatableMemory", "datapointName": "kubeNodeStatusAllocatableMemory", "consolidationFn": "average"}, {"name": "kubeNodeStatusCapacityMemory", "datapointName": "kubeNodeStatusCapacityMemory", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "kubeNodeStatusAllocatableMemory", "color": "navy", "datapointName": "kubeNodeStatusAllocatableMemory", "isVirtual": false}, {"type": "area", "legend": "kubeNodeStatusCapacityMemory", "color": "lime", "datapointName": "kubeNodeStatusCapacityMemory", "isVirtual": false}]}, {"name": "Memory Page Faults", "title": "Memory Page Faults", "verticalLabel": "count", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "memoryMajorPageFaults", "datapointName": "memoryMajorPageFaults", "consolidationFn": "average"}, {"name": "memoryPageFaults", "datapointName": "memoryPageFaults", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "memoryMajorPageFaults", "color": "red1", "datapointName": "memoryMajorPageFaults", "isVirtual": false}, {"type": "line", "legend": "memoryPageFaults", "color": "silver", "datapointName": "memoryPageFaults", "isVirtual": false}]}, {"name": "Metrics Availability", "title": "Metrics Availability", "verticalLabel": "count", "min": -1.0, "max": 2.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ksmMetricsAvailable", "datapointName": "ksmMetricsAvailable", "consolidationFn": "max"}, {"name": "summaryMetricsAvailable", "datapointName": "summaryMetricsAvailable", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "ksmMetricsAvailable", "color": "silver", "datapointName": "ksmMetricsAvailable", "isVirtual": false}, {"type": "line", "legend": "summaryMetricsAvailable", "color": "lime", "datapointName": "summaryMetricsAvailable", "isVirtual": false}]}, {"name": "Network Errors", "title": "Network Errors", "verticalLabel": "count", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "networkRxErrors", "datapointName": "networkRxErrors", "consolidationFn": "max"}, {"name": "networkTxErrors", "datapointName": "networkTxErrors", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "networkRxErrors", "color": "red", "datapointName": "networkRxErrors", "isVirtual": false}, {"type": "line", "legend": "networkTxErrors", "color": "yellow", "datapointName": "networkTxErrors", "isVirtual": false}]}, {"name": "Network Throughput", "title": "Network Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "networkRxBytes", "datapointName": "networkRxBytes", "consolidationFn": "max"}, {"name": "networkTxBytes", "datapointName": "networkTxBytes", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "networkRxBytes", "color": "silver", "datapointName": "networkRxBytes", "isVirtual": false}, {"type": "line", "legend": "networkTxBytes", "color": "lime", "datapointName": "networkTxBytes", "isVirtual": false}]}, {"name": "Pod Capacity", "title": "Pod Capacity", "verticalLabel": "count", "min": 0.0, "displayPriority": 16, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeNodeStatusAllocatablePods", "datapointName": "kubeNodeStatusAllocatablePods", "consolidationFn": "max"}, {"name": "kubeNodeStatusCapacityPods", "datapointName": "kubeNodeStatusCapacityPods", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "kubeNodeStatusAllocatablePods", "color": "silver", "datapointName": "kubeNodeStatusAllocatablePods", "isVirtual": false}, {"type": "line", "legend": "kubeNodeStatusCapacityPods", "color": "lime", "datapointName": "kubeNodeStatusCapacityPods", "isVirtual": false}]}, {"name": "Start Duration", "title": "Start Duration", "verticalLabel": "days", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "nodeUptimeDays", "datapointName": "nodeUptimeDays", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "nodeUptimeDays", "color": "silver", "datapointName": "nodeUptimeDays", "isVirtual": false}]}, {"name": "Taints", "title": "Taints", "verticalLabel": "count", "min": 0.0, "displayPriority": 26, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeNodeSpecTaint", "datapointName": "kubeNodeSpecTaint", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "kubeNodeSpecTaint", "color": "silver", "datapointName": "kubeNodeSpecTaint", "isVirtual": false}]}, {"name": "Unschedulable", "title": "Unschedulable", "verticalLabel": "count", "min": -1.0, "displayPriority": 29, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubeNodeSpecUnschedulable", "datapointName": "kubeNodeSpecUnschedulable", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "kubeNodeSpecUnschedulable", "color": "silver", "datapointName": "kubeNodeSpecUnschedulable", "isVirtual": false}]}, {"name": "fs", "title": "fs", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 15, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "fsAvailableBytes", "datapointName": "fsAvailableBytes", "consolidationFn": "average"}, {"name": "fsCapacityBytes", "datapointName": "fsCapacityBytes", "consolidationFn": "average"}, {"name": "fsUsedBytes", "datapointName": "fsUsedBytes", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "fsAvailableBytes", "color": "lime", "datapointName": "fsAvailableBytes", "isVirtual": false}, {"type": "line", "legend": "fsCapacityBytes", "color": "silver", "datapointName": "fsCapacityBytes", "isVirtual": false}, {"type": "line", "legend": "fsUsedBytes", "color": "yellow", "datapointName": "fsUsedBytes", "isVirtual": false}]}, {"name": "iNodes", "title": "iNodes", "verticalLabel": "count", "min": 0.0, "displayPriority": 21, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "fsInodes", "datapointName": "fsInodes", "consolidationFn": "average"}, {"name": "fsInodesFree", "datapointName": "fsInodesFree", "consolidationFn": "average"}, {"name": "fsInodesUsed", "datapointName": "fsInodesUsed", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "fsInodes", "color": "silver", "datapointName": "fsInodes", "isVirtual": false}, {"type": "line", "legend": "fsInodesFree", "color": "lime", "datapointName": "fsInodesFree", "isVirtual": false}, {"type": "line", "legend": "fsInodesUsed", "color": "yellow", "datapointName": "fsInodesUsed", "isVirtual": false}]}]}

×DataSource: Kubernetes_KSM_Pods (2481809)

{"name": "Kubernetes_KSM_Pods", "description": "Monitors Kubernetes Pods via KSM", "appliesTo": "hasCategory(\"KubernetesPod\")", "searchKeywords": "kube-state-metrics,kubernetes,pod,ksm,container orchestration", "displayedAs": "Pod (KSM)", "collectionInterval": "1m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.groovyapi.http.Client\nimport com.santaba.agent.groovyapi.http.SSLClient\nimport groovy.json.JsonSlurper\nimport groovy.json.JsonOutput\nimport org.apache.http.params.HttpConnectionParams\nimport java.lang.reflect.Field\nimport com.santaba.agent.groovyapi.http.HTTP\n\ndef podUid = hostProps.get(\"auto.uid\")\n\ndef k8s_info = getKubernetesProperties( hostProps, instanceProps )\n\nMap conditionMap = [\"false\" : 0, \"true\" : 1, \"unknown\" : 2]\nMap phaseMap = [\n \"Pending\" : 0,\n \"Running\" : 1,\n \"Succeeded\" : 2,\n \"Failed\" : 3,\n \"Unknown\" : 4\n]\nMap reasonMap = [\n \"NodeLost\" : 1,\n \"Evicted\" : 2,\n \"UnexpectedAdmissionError\" :3\n]\n\nList targetMetrics = [\n// \"kube_pod_info\",kube_pod_inf\n \"kube_pod_start_time\",\n// \"kube_pod_completion_time\",\n// \"kube_pod_owner\",\n// \"kube_pod_labels\",\n// \"kube_pod_container_info\",\n \"kube_pod_container_status_waiting\",\n \"kube_pod_container_status_waiting_reason\",\n \"kube_pod_container_status_running\",\n \"kube_pod_container_state_started\",\n \"kube_pod_container_status_terminated\",\n \"kube_pod_container_status_terminated_reason\",\n \"kube_pod_container_status_last_terminated_reason\",\n \"kube_pod_container_status_ready\",\n \"kube_pod_container_status_restarts_total\",\n// \"kube_pod_container_resource_requests\",\n// \"kube_pod_container_resource_limits\",\n// \"kube_pod_overhead_cpu_cores\",\n// \"kube_pod_overhead_memory_bytes\",\n// \"kube_pod_runtimeclass_name_info\",\n// \"kube_pod_created\",\n// \"kube_pod_deletion_timestamp\",\n// \"kube_pod_restart_policy\",\n// \"kube_pod_init_container_info\",\n// \"kube_pod_init_container_status_waiting\",\n// \"kube_pod_init_container_status_waiting_reason\",\n// \"kube_pod_init_container_status_running\",\n// \"kube_pod_init_container_status_terminated\",\n// \"kube_pod_init_container_status_terminated_reason\",\n// \"kube_pod_init_container_status_last_terminated_reason\",\n// \"kube_pod_init_container_status_ready\",\n// \"kube_pod_init_container_status_restarts_total\",\n// \"kube_pod_init_container_resource_limits\",\n// \"kube_pod_init_container_resource_limits_cpu_cores\",\n// \"kube_pod_init_container_resource_limits_memory_bytes\",\n// \"kube_pod_init_container_resource_limits_storage_bytes\",\n// \"kube_pod_init_container_resource_limits_ephemeral_storage_bytes\",\n// \"kube_pod_init_container_resource_requests\",\n// \"kube_pod_init_container_resource_requests_cpu_cores\",\n// \"kube_pod_init_container_resource_requests_memory_bytes\",\n// 'kube_pod_init_container_resource_requests_storage_bytes',\n// \"kube_pod_init_container_resource_requests_ephemeral_storage_bytes\",\n// \"kube_pod_spec_volumes_persistentvolumeclaims_info\",\n// 'kube_pod_spec_volumes_persistentvolumeclaims_readonly',\n// \"kube_pod_status_scheduled_time\",\n \"kube_pod_status_unschedulable\"\n]\n\ndef hostIP = \"\"\ndef podIP = \"\"\ndef ksmMetricsKey = \"ksmMetricsAvailable\"\ndef summaryMetricsKey = \"summaryMetricsAvailable\"\n\n// Some boilerplate\ncollectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n\nLong now = (new Date()).getTime()\nLong lastUpdate = (collectorCache.get(makeKey(\"fetchTask\", \"lastCheckIn\"))?:now+1).toLong()\nprintln \"collectionDelay=${now-lastUpdate}\"\n\ndef payload = collectorCache.get(makeKey(\"data\", \"payload\"))\n\nif (payload) {\n println \"${ksmMetricsKey}=1\"\n List metrics = openmetricsParse(payload)\n def podMetrics = metrics.findAll { metricData -> metricData.labels.uid == podUid }\n\n def phaseValue = findEnumeration(podMetrics, \"kube_pod_status_phase\", \"phase\")\n println \"kube_pod_status_phase=${phaseMap[phaseValue]}\"\n def readyValue = findEnumeration(podMetrics, \"kube_pod_status_ready\", \"condition\")\n println \"kube_pod_status_ready=${conditionMap[readyValue]}\"\n def reasonValue = findEnumeration(podMetrics, \"kube_pod_status_reason\", \"reason\")\n println \"kube_pod_status_reason=${reasonMap[reasonValue]}\"\n def scheduledValue = findEnumeration(podMetrics, \"kube_pod_status_scheduled\", \"condition\")\n println \"kube_pod_status_scheduled=${conditionMap[scheduledValue]}\"\n findResourceValues(podMetrics, \"kube_pod_container_resource_limits\").each{\n println \"kube_pod_container_resource_limits_${it.labels.resource}=${it.value}\"\n }\n findResourceValues(podMetrics, \"kube_pod_container_resource_requests\").each{\n println \"kube_pod_container_resource_requests_${it.labels.resource}=${it.value}\"\n }\n targetMetrics.each{metric ->\n def targetData = podMetrics.find{ metric == it.name }\n println \"${metric}=${targetData?.value}\"\n }\n findResourceValues(podMetrics, \"kube_pod_info\").each{\n hostIP = it.labels.host_ip\n podIP = it.labels.pod_ip\n }\n\n def use_ssl = true\n def insecure_port = 10255\n def secure_port = 10250\n def summaryMetricsValue = 0\n\n try { // Attempt secure port w/ SSL\n print getKubernetesPodMetrics( k8s_info, secure_port, use_ssl, hostIP, podIP )\n summaryMetricsValue = 1\n } catch (ConnectException e) { // Attempt to use insecure port 10255 without SSL on failure\n print getKubernetesPodMetrics( k8s_info, insecure_port, !use_ssl, hostIP, podIP )\n summaryMetricsValue = 1\n } catch (SocketTimeoutException e) {\n println e\n }\n\n println \"${summaryMetricsKey}=${summaryMetricsValue}\"\n\n} else {\n println \"${ksmMetricsKey}=0\"\n println \"${summaryMetricsKey}=0\"\n println \"Could not find a cached payload\"\n return 1\n}\n\nreturn 0\n\nstatic List findResourceValues(List metrics, String identifier){\n def allMatches = metrics.findAll{ it.name == identifier }\n return allMatches\n}\n\nstatic String findEnumeration(List metrics, String identifier, String ksmKey){\n def trueValue = metrics.find { it.name == identifier && it.value == \"1\"}\n return trueValue?.labels?.getAt(ksmKey)\n}\n\nstatic String makeKey( String facility, String attributeName) {\n return \"KubernetesKSM:${facility}.${attributeName}\"\n}\n\ndef getKubernetesProperties( parent_hostProps, parent_instanceProps )\n{\n def k8s_namespace = parent_hostProps?.get(\"auto.namespace\")\n def k8s_name = parent_hostProps?.get(\"auto.name\")\n def k8s_nodename = parent_hostProps?.get(\"auto.nodename\")\n def k8s_selflink = parent_hostProps?.get(\"auto.selflink\")\n def k8s_hostname = parent_hostProps?.get(\"system.hostname\")\n def k8s_ssl = parent_hostProps?.get(\"auto.kubernetes.label.ssl\") ? parent_hostProps?.get(\"auto.kubernetes.label.ssl\") : true\n\n def env = System.getenv()\n def k8s_service_host = env[\"KUBERNETES_SERVICE_HOST\"]\n def k8s_service_port = env.get(\"KUBERNETES_SERVICE_PORT\")?.toInteger()?:443\n\n def k8s_service_ssl = (k8s_service_port == 443)\n if ( k8s_ssl ) { k8s_service_ssl = k8s_ssl }\n\n def k8s_serviceaccount_token = new File('/var/run/secrets/kubernetes.io/serviceaccount/token').text\n def request_headers = [\"Authorization\" : \"Bearer ${k8s_serviceaccount_token}\"];\n\n return [\n k8s_namespace: k8s_namespace,\n k8s_name: k8s_name,\n k8s_serviceaccount_token: k8s_serviceaccount_token,\n k8s_selflink: k8s_selflink,\n k8s_service_host: k8s_service_host,\n k8s_service_port: k8s_service_port,\n k8s_service_ssl: k8s_service_ssl,\n k8s_nodename: k8s_nodename,\n k8s_hostname: k8s_hostname\n ]\n}\n\ndef getKubernetesPodMetrics( k8s_info, port, use_ssl, hostIP, podIP ) {\n // define a struct that contains the different server info for this query\n def metrics_info = [\n k8s_service_host: (hostIP ?: podIP),\n k8s_service_port: port,\n k8s_service_ssl: use_ssl,\n k8s_serviceaccount_token: k8s_info.k8s_serviceaccount_token,\n ]\n\n def metrics_endpoint = \"/stats/summary/\"\n long startTime = System.currentTimeMillis(); \n def json = queryAPI( metrics_endpoint, metrics_info )\n println \"Total time : \" + (System.currentTimeMillis() - startTime)\n collectorCache.set(\"Summary_\"+k8s_info.k8s_namespace+\"_\"+k8s_info.k8s_name, JsonOutput.toJson(json), Integer.valueOf(collectorCache.get(makeKey(\"watchdog\", \"pollInterval\")))*2)\n\n def output = \"\"\n // collect the pods that match the given pod name in the metrics output. Should only be one object.\n def pod = json.pods?.findAll { pod -> pod.podRef.name == k8s_info.k8s_name }[0]\n\n if (pod) {\n if (pod.cpu) {\n output += \"cpu_usageNanoCores=${pod.cpu.usageNanoCores}\\n\"\n output += \"cpu_usageCoreNanoSeconds=${pod.cpu.usageCoreNanoSeconds}\\n\"\n }\n \n if (pod.memory) {\n output += \"memory_usageBytes=${pod.memory.usageBytes}\\n\"\n output += \"memory_workingSetBytes=${pod.memory.workingSetBytes}\\n\"\n output += \"memory_rssBytes=${pod.memory.rssBytes}\\n\"\n output += \"memory_pageFaults=${pod.memory.pageFaults}\\n\"\n output += \"memory_majorPageFaults=${pod.memory.majorPageFaults}\\n\"\n }\n\n if (pod.network) {\n output += \"network_rxBytes=${pod.network.rxBytes}\\n\"\n output += \"network_rxErrors=${pod.network.rxErrors}\\n\"\n output += \"network_txBytes=${pod.network.txBytes}\\n\"\n output += \"network_txErrors=${pod.network.txErrors}\\n\"\n }\n\n if (pod.volume) {\n def volume_availableBytes = 0\n def volume_capacityBytes = 0\n def volume_usedBytes = 0\n def volume_inodesFree = 0\n def volume_inodes = 0\n def volume_inodesUsed = 0\n pod.volume.each { vol -> \n if (vol) {\n volume_availableBytes += vol.availableBytes\n volume_capacityBytes += vol.capacityBytes\n volume_usedBytes += vol.usedBytes\n volume_inodesFree += vol.inodesFree\n volume_inodes += vol.inodes\n volume_inodesUsed += vol.inodesUsed\n }\n }\n output += \"volume_availableBytes=${volume_availableBytes}\\n\"\n output += \"volume_capacityBytes=${volume_capacityBytes}\\n\"\n output += \"volume_usedBytes=${volume_usedBytes}\\n\"\n output += \"volume_inodesFree=${volume_inodesFree}\\n\"\n output += \"volume_inodes=${volume_inodes}\\n\"\n output += \"volume_inodesUsed=${volume_inodesUsed}\\n\"\n }\n }\n\n return output\n}\n// - RESTAPI\ndef queryAPI( String api_endpoint, k8s_info ) {\n def http = HTTP.open(k8s_info.k8s_service_host, k8s_info.k8s_service_port, k8s_info.k8s_service_ssl )\n def request_headers = [ \"Authorization\" : \"Bearer ${k8s_info.k8s_serviceaccount_token}\" ]\n\n if (http instanceof SSLClient) {\n SSLClient s = (SSLClient)http\n Field f = Client.class.getDeclaredField(\"_client\")\n f.setAccessible(true)\n HttpConnectionParams.setConnectionTimeout(f.get(s).getParams(), 1000 * 15)\n HttpConnectionParams.setSoTimeout(f.get(s).getParams(), 1000 * 15)\n }\n println \"Endpoint : \" + api_endpoint\n http.get(api_endpoint, request_headers)\n\n def result = false\n if ( http.statusCode == 200 ) {\n result = new JsonSlurper().parseText( http.getResponseBody() )\n }\n http.close()\n \n return result\n}\n\n// Parse scraped openmetrics payload into a list of maps.\nList openmetricsParse(body) {\n def metricTypes = [:]\n def metricHelp = [:]\n def metrics = []\n\n // Iterate through the metric page, parse and print out metrics\n List METRIC_SUFIXES = [\"_sum\", \"_bucket\", \"_count\", ]\n\n body.eachLine { line ->\n if (line.trim() == \"\") return // Completely ignore empty lines\n def splitLine = line.tokenize(\" \")\n splitLine = line.toString().split(\"\\\\s+(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*\\$)\")\n if (line.startsWith(\"#\")) {\n if (line.startsWith(\"# HELP\") || line.startsWith(\"# TYPE\")) {\n\n def directiveType = splitLine[1]\n def metricName = splitLine[2]\n\n if (directiveType == \"HELP\") {\n metricHelp[metricName] = line[line.indexOf(metricName) + metricName.size()..-1]\n }\n\n if (directiveType == \"TYPE\") {\n metricTypes[metricName] = splitLine[3]\n }\n }\n }\n else {\n if(splitLine.size() < 2) {\n println(\"ERROR: Invalid line: ${line}\")\n return\n }\n\n def metricDef = splitLine[0]\n def metricLabels = [:]\n def metricName = metricDef\n def metricValue\n def sampleType = \"\"\n\n if(metricDef.contains(\"{\")){\n metricName = metricDef.tokenize(\"{\")[0]\n String labelPayload = metricDef[metricDef.indexOf(\"{\")+1..metricDef.lastIndexOf(\"}\")-1]\n labelPayload.split(/(,)(?=(?:[^\"]|\"[^\"]*\")*$)/).each {\n it = it.trim()\n String labelKey = it.tokenize(\"=\")[0]\n String labelValue = it[labelKey.size()+2..-2]\n metricLabels[labelKey] = labelValue\n }\n }\n\n for (String suffix : METRIC_SUFIXES) {\n if (metricName.endsWith(suffix)) {\n sampleType = suffix\n metricName = metricName.substring(0, metricName.size() - suffix.size())\n }\n }\n\n metricValue = splitLine[1]\n def metric = [\"name\": metricName,\n \"labels\": metricLabels,\n \"sampleType\": sampleType,\n \"value\": metricValue,\n \"type\": metricTypes.get(metricName, \"untyped\")]\n\n if (splitLine.size() == 3) {\n def metricTimestamp = splitLine[3]\n metric[\"timestamp\"] = metricTimestamp\n }\n metrics << metric\n }\n }\n return metrics\n}"}, "datapoints": [{"name": "collectionDelay", "description": "KSM metrics last update delay in ms.", "interpretMethod": "namevalue", "interpretExpr": "collectionDelay", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpuLimits", "description": "Amount of compute resources the pod is restricted to provide.", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_container_resource_limits_cpu", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpuRequestPercent", "description": "Percentage of pod CPU requests as compared to its overall limits on available CPU resources.\nNote: This value will be null when CPU limits are not set.", "interpretMethod": "expression", "interpretExpr": "if(gt(cpuLimits,0),cpuRequests/cpuLimits*100,unkn())", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpuRequests", "description": "Number of compute resources ( nano-cores ) that have been requested.", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_container_resource_requests_cpu", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpuUsageCoreNanoSeconds", "description": "CPU time used by the pod, in nanoseconds.", "interpretMethod": "namevalue", "interpretExpr": "cpu_usageCoreNanoSeconds", "useValue": "output", "type": "counter", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "cpuUsageNanoCores", "description": "CPU usage nano cores", "interpretMethod": "namevalue", "interpretExpr": "cpu_usageNanoCores", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ksmMetricsAvailable", "description": "Availability of KSM Metrics from Watchdog\n0 - Not Available\n1 - Available", "interpretMethod": "namevalue", "interpretExpr": "ksmMetricsAvailable", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePodContainerStatusReady", "description": "Describes whether the containers readiness check succeeded", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_container_status_ready", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePodContainerStatusRestartsTotal", "description": "The number of container restarts per container", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_container_status_restarts_total", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePodContainerStatusRunning", "description": "Describes whether the container is currently in running state", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_container_status_running", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePodContainerStatusTerminated", "description": "Describes whether the container is currently in terminated state", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_container_status_terminated", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePodContainerStatusWaiting", "description": "Describes whether the container is currently in waiting state", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_container_status_waiting", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePodStartTime", "description": "Start time in unix timestamp for a pod", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_start_time", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePodStatusReady", "description": "Describes whether the pod is ready to serve requests.\n0=No, 1=Yes, 2=Unknown", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_status_ready", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePodStatusScheduled", "description": "Describes the status of the scheduling process for the pod", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_status_scheduled", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "kubePodStatusUnschedulable", "description": "Describes the unschedulable status for the pod", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_status_unschedulable", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "threshold": "> 1", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertSubject": "Kubernetes Pod is Unschedulable", "alertBody": "The Kubernetes Pod ##INSTANCE##, is in an unschedulable state with value of\n ##VALUE##, hence ##HOST## has raised ##LEVEL## alert.\n\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "memoryLimits", "description": "Amount of memory the pod is restricted to provide.", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_container_resource_limits_memory", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryMajorPageFaults", "description": "Number of major page faults detected.", "interpretMethod": "namevalue", "interpretExpr": "memory_majorPageFaults", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryPageFaults", "description": "Number of memory page faults detected.", "interpretMethod": "namevalue", "interpretExpr": "memory_pageFaults", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryRequestPercent", "description": "Percentage of pod memory requests as compared to its overall limits on available memory resources.\nNote: This value will be null when memory limits are not set.", "interpretMethod": "expression", "interpretExpr": "if(gt(memoryLimits,0),memoryRequests/memoryLimits*100,unkn())", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryRequests", "description": "Amount of memory that has been requested.", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_container_resource_requests_memory", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryRssBytes", "description": "Amount of resident set size ( active ) memory used by the pod, in bytes. Typically the memory allocated to the process(es) that is in use in RAM.", "interpretMethod": "namevalue", "interpretExpr": "memory_rssBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryUsageBytes", "description": "Total memory in use, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "memory_usageBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "memoryUsagePercent", "description": "Percentage of pod memory usage as compared to its overall limits on available memory resources.\nNote: This value will be null when memory limits are not set.", "interpretMethod": "expression", "interpretExpr": "if(gt(memoryLimits,0), memoryWorkingSetBytes/memoryLimits*100, unkn())", "type": "gauge", "dataType": 7, "min": "0", "threshold": ">= 85 95", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0, "alertSubject": "High Kubernetes Pod Memory Usage", "alertBody": "The memory of Kubernetes Pod ##HOST## is now at ##VALUE## percent usage, which puts this host in a ##LEVEL## state. \n\nThis started at ##START## -- or ##DURATION## ago."}, {"name": "memoryWorkingSetBytes", "description": "Amount of memory pages recently utilized, in bytes.", "interpretMethod": "namevalue", "interpretExpr": "memory_workingSetBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "networkRxBits", "description": "Network ingress traffic, converted to bits-per-second.", "interpretMethod": "expression", "interpretExpr": "networkRxBytes*8", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "networkRxBytes", "description": "Number of bytes received by the pod.", "interpretMethod": "namevalue", "interpretExpr": "network_rxBytes", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "networkRxErrors", "description": "Number of transmission errors observed on inbound pod traffic.", "interpretMethod": "namevalue", "interpretExpr": "network_rxErrors", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "networkTxBits", "description": "Network egress traffic, converted to bits-per-second.", "interpretMethod": "expression", "interpretExpr": "networkTxBytes*8", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "networkTxBytes", "description": "Number of bytes transmitted by the pod.", "interpretMethod": "namevalue", "interpretExpr": "network_txBytes", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "networkTxErrors", "description": "Number of transmission errors observed on outbound pod traffic.", "interpretMethod": "namevalue", "interpretExpr": "network_txErrors", "useValue": "output", "type": "derive", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "podConditionPhase", "description": "Current phase the pod is in.\n\n0 = PENDING: The Pod has been accepted by the Kubernetes system, but one or more of the Container images has not been created.\n1 = RUNNING: The Pod has been bound to a node, and all of the Containers have been created. At least one Container is still running, or is in the process of starting or restarting.\n2 = SUCCEEDED: All Containers in the Pod have terminated in success, and will not be restarted.\n3 = FAILED: All Containers in the Pod have terminated, and at least one Container has terminated in failure.\n4 = UNKNOWN: For some reason the state of the Pod could not be obtained, typically due to an error in communicating with the host of the Pod.", "interpretMethod": "namevalue", "interpretExpr": "kube_pod_status_phase", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "podUp", "description": "Calculation of pod state based on phase and condition metrics.\n1=Pod is running and ready to serve requests", "interpretMethod": "expression", "interpretExpr": "&&(eq(podConditionPhase,1),eq(kubePodStatusReady,1))", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "!= 1", "noData": "Do not trigger an alert", "triggerInterval": 10, "clearInterval": 0, "alertSubject": "Kubernetes Pod State is Not Optimal", "alertBody": "The Kubernetes Pod ##INSTANCE##, according to it's reported phase and condition status, has a value of \n ##VALUE##, placing the ##HOST## device into ##LEVEL## state.\n\nThis calculation is based on both the Pod Phase and Pod Condition metrics.\n\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "podUptime", "description": "Time in seconds since the pod is in start state.", "interpretMethod": "expression", "interpretExpr": "now()-kubePodStartTime", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "podUptimeDays", "description": "Time in Days since the pod is in start state.", "interpretMethod": "expression", "interpretExpr": "podUptime/86400", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "summaryMetricsAvailable", "description": "Availability of Node Metrics from Summary API\n0 - Not Available\n1 - Available", "interpretMethod": "namevalue", "interpretExpr": "summaryMetricsAvailable", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "volumeAvailableBytes", "description": "Total available bytes for all volumes used by Pod.", "interpretMethod": "namevalue", "interpretExpr": "volume_availableBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "volumeCapacityBytes", "description": "Total capacity for all volumes used by Pod in bytes.", "interpretMethod": "namevalue", "interpretExpr": "volume_capacityBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "volumeInodes", "description": "Total iNodes for all volumes used by Pod.", "interpretMethod": "namevalue", "interpretExpr": "volume_inodes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "volumeInodesFree", "description": "Total Inodes free across all volumes used by Pod.", "interpretMethod": "namevalue", "interpretExpr": "volume_inodesFree", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "volumeInodesUsed", "description": "Total Inodes used across all volumes used by Pod.", "interpretMethod": "namevalue", "interpretExpr": "volume_inodesUsed", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "volumeUsedBytes", "description": "Total used bytes across all volumes used by Pod.", "interpretMethod": "namevalue", "interpretExpr": "volume_usedBytes", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "CPU Limits / Requests", "title": "CPU Limits / Requests", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 12, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "cpuLimits", "datapointName": "cpuLimits", "consolidationFn": "average"}, {"name": "cpuRequests", "datapointName": "cpuRequests", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "cpuLimits", "color": "olive", "datapointName": "cpuLimits", "isVirtual": false}, {"type": "line", "legend": "cpuRequests", "color": "silver", "datapointName": "cpuRequests", "isVirtual": false}]}, {"name": "CPU Time", "title": "CPU Time", "verticalLabel": "nanoseconds", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cpuUsageCoreNanoSeconds", "datapointName": "cpuUsageCoreNanoSeconds", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "cpuUsageCoreNanoSeconds", "color": "green", "datapointName": "cpuUsageCoreNanoSeconds", "isVirtual": false}]}, {"name": "CPU Usage Nano Cores", "title": "CPU Usage Nano Cores", "verticalLabel": "count", "min": 0.0, "displayPriority": 14, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cpuUsageNanoCores", "datapointName": "cpuUsageNanoCores", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "cpuUsageNanoCores", "color": "silver", "datapointName": "cpuUsageNanoCores", "isVirtual": false}]}, {"name": "Collection Delay", "title": "Collection Delay", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 13, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "collectionDelay", "datapointName": "collectionDelay", "consolidationFn": "max"}], "virtualDatapoints": [{"name": "delayInSeconds", "expr": "collectionDelay/1000"}], "lines": [{"type": "line", "legend": "Delay", "color": "blue", "datapointName": "delayInSeconds", "isVirtual": true}]}, {"name": "Condition", "title": "Condition (Phase)", "verticalLabel": "status code", "min": -1.0, "max": 5.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "podConditionPhase", "datapointName": "podConditionPhase", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Pod Phase", "color": "silver", "datapointName": "podConditionPhase", "isVirtual": false}]}, {"name": "Container Restarts", "title": "Container Restarts", "verticalLabel": "count", "min": 0.0, "displayPriority": 20, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kube_pod_container_status_restarts_total", "datapointName": "kubePodContainerStatusRestartsTotal", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "kube_pod_container_status_restarts_total", "color": "purple", "datapointName": "kube_pod_container_status_restarts_total", "isVirtual": false}]}, {"name": "Container State", "title": "Container State", "verticalLabel": "0=not running, 1=running", "min": -1.0, "max": 2.0, "displayPriority": 19, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kube_pod_container_status_ready", "datapointName": "kubePodContainerStatusReady", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "kube_pod_container_status_ready", "color": "lime", "datapointName": "kube_pod_container_status_ready", "isVirtual": false}]}, {"name": "Container Status", "title": "Container Status", "verticalLabel": "0=false, 1=true", "min": -1.0, "max": 2.0, "displayPriority": 18, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kube_pod_container_status_running", "datapointName": "kubePodContainerStatusRunning", "consolidationFn": "max"}, {"name": "kube_pod_container_status_terminated", "datapointName": "kubePodContainerStatusTerminated", "consolidationFn": "max"}, {"name": "kube_pod_container_status_waiting", "datapointName": "kubePodContainerStatusWaiting", "consolidationFn": "max"}], "lines": [{"type": "area", "legend": "kube_pod_container_status_running", "color": "olive", "datapointName": "kube_pod_container_status_running", "isVirtual": false}, {"type": "area", "legend": "kube_pod_container_status_terminated", "color": "red", "datapointName": "kube_pod_container_status_terminated", "isVirtual": false}, {"type": "area", "legend": "kube_pod_container_status_waiting", "color": "yellow", "datapointName": "kube_pod_container_status_waiting", "isVirtual": false}]}, {"name": "Health", "title": "Health", "verticalLabel": "0=not running, 1=running", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "podUp", "datapointName": "podUp", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "Pod Health", "color": "silver", "datapointName": "podUp", "isVirtual": false}]}, {"name": "Memory", "title": "Memory", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "memoryRssBytes", "datapointName": "memoryRssBytes", "consolidationFn": "max"}, {"name": "memoryUsageBytes", "datapointName": "memoryUsageBytes", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "memoryRssBytes", "color": "lime", "datapointName": "memoryRssBytes", "isVirtual": false}, {"type": "line", "legend": "memoryUsageBytes", "color": "silver", "datapointName": "memoryUsageBytes", "isVirtual": false}]}, {"name": "Memory Limits / Requests", "title": "Memory Limits / Requests", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "memoryLimits", "datapointName": "memoryLimits", "consolidationFn": "max"}, {"name": "memoryRequests", "datapointName": "memoryRequests", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "memoryLimits", "color": "silver", "datapointName": "memoryLimits", "isVirtual": false}, {"type": "line", "legend": "memoryRequests", "color": "lime", "datapointName": "memoryRequests", "isVirtual": false}]}, {"name": "Memory Page Faults", "title": "Memory Page Faults", "verticalLabel": "count", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "memoryMajorPageFaults", "datapointName": "memoryMajorPageFaults", "consolidationFn": "average"}, {"name": "memoryPageFaults", "datapointName": "memoryPageFaults", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "memoryMajorPageFaults", "color": "red1", "datapointName": "memoryMajorPageFaults", "isVirtual": false}, {"type": "line", "legend": "memoryPageFaults", "color": "silver", "datapointName": "memoryPageFaults", "isVirtual": false}]}, {"name": "Memory Usage %", "title": "Memory Usage %", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "memoryUsagePercent", "datapointName": "memoryUsagePercent", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "memoryUsagePercent", "color": "silver", "datapointName": "memoryUsagePercent", "isVirtual": false}]}, {"name": "Metrics Availability", "title": "Metrics Availability", "verticalLabel": "count", "min": -1.0, "max": 2.0, "displayPriority": 50, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ksmMetricsAvailable", "datapointName": "ksmMetricsAvailable", "consolidationFn": "max"}, {"name": "summaryMetricsAvailable", "datapointName": "summaryMetricsAvailable", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "ksmMetricsAvailable", "color": "silver", "datapointName": "ksmMetricsAvailable", "isVirtual": false}, {"type": "line", "legend": "summaryMetricsAvailable", "color": "lime", "datapointName": "summaryMetricsAvailable", "isVirtual": false}]}, {"name": "Network Errors", "title": "Network Errors", "verticalLabel": "count", "min": 0.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "networkRxErrors", "datapointName": "networkRxErrors", "consolidationFn": "max"}, {"name": "networkTxErrors", "datapointName": "networkTxErrors", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "networkRxErrors", "color": "red", "datapointName": "networkRxErrors", "isVirtual": false}, {"type": "line", "legend": "networkTxErrors", "color": "red2", "datapointName": "networkTxErrors", "isVirtual": false}]}, {"name": "Network Throughput", "title": "Network Throughput", "verticalLabel": "bps", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "networkRxBits", "datapointName": "networkRxBits", "consolidationFn": "average"}, {"name": "networkTxBits", "datapointName": "networkTxBits", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "networkRxBits", "color": "silver", "datapointName": "networkRxBits", "isVirtual": false}, {"type": "line", "legend": "networkTxBits", "color": "olive", "datapointName": "networkTxBits", "isVirtual": false}]}, {"name": "Requests %", "title": "Requests %", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "cpuRequestPercent", "datapointName": "cpuRequestPercent", "consolidationFn": "average"}, {"name": "memoryRequestPercent", "datapointName": "memoryRequestPercent", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "cpuRequestPercent", "color": "silver", "datapointName": "cpuRequestPercent", "isVirtual": false}, {"type": "line", "legend": "memoryRequestPercent", "color": "lime", "datapointName": "memoryRequestPercent", "isVirtual": false}]}, {"name": "Scheduled Status", "title": "Scheduled Status", "verticalLabel": "status code", "min": -1.0, "max": 3.0, "displayPriority": 15, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "kubePodStatusScheduled", "datapointName": "kubePodStatusScheduled", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "kubePodStatusScheduled", "color": "silver", "datapointName": "kubePodStatusScheduled", "isVirtual": false}]}, {"name": "Start Duration", "title": "Start Duration", "verticalLabel": "days", "min": 0.0, "displayPriority": 16, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "podUptimeDays", "datapointName": "podUptimeDays", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "podUptimeDays", "color": "silver", "datapointName": "podUptimeDays", "isVirtual": false}]}, {"name": "Volume INodes", "title": "Volume INodes", "verticalLabel": "count", "min": 0.0, "displayPriority": 21, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "volumeInodes", "datapointName": "volumeInodes", "consolidationFn": "average"}, {"name": "volumeInodesFree", "datapointName": "volumeInodesFree", "consolidationFn": "average"}, {"name": "volumeInodesUsed", "datapointName": "volumeInodesUsed", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "volumeInodes", "color": "yellow", "datapointName": "volumeInodes", "isVirtual": false}, {"type": "line", "legend": "volumeInodesFree", "color": "lime", "datapointName": "volumeInodesFree", "isVirtual": false}, {"type": "line", "legend": "volumeInodesUsed", "color": "silver", "datapointName": "volumeInodesUsed", "isVirtual": false}]}, {"name": "Volumes", "title": "Volumes", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 22, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "volumeAvailableBytes", "datapointName": "volumeAvailableBytes", "consolidationFn": "average"}, {"name": "volumeCapacityBytes", "datapointName": "volumeCapacityBytes", "consolidationFn": "average"}, {"name": "volumeUsedBytes", "datapointName": "volumeUsedBytes", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "volumeAvailableBytes", "color": "silver", "datapointName": "volumeAvailableBytes", "isVirtual": false}, {"type": "area", "legend": "volumeCapacityBytes", "color": "lime", "datapointName": "volumeCapacityBytes", "isVirtual": false}, {"type": "area", "legend": "volumeUsedBytes", "color": "yellow", "datapointName": "volumeUsedBytes", "isVirtual": false}]}]}

×DataSource: Kubernetes_KSM_Watchdog (2481810)

{"name": "Kubernetes_KSM_Watchdog", "description": "Kubernetes kube-state-metrics watchdog.", "appliesTo": "system.devicetype == \"8\" && system.collector == \"true\"", "searchKeywords": "kubernetes,watchdog,ksm,kubernetes watchdog", "displayedAs": "Kube State Metrics Watchdog", "collectionInterval": "1m", "collectionMethod": "script", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"type": "groovy", "content": "/*******************************************************************************\n * \u00a9 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\n\nimport com.santaba.agent.collector3.CollectorDb\nimport com.santaba.agent.util.script.ScriptCache\nimport com.santaba.common.logger.LogMsg\nimport groovy.json.JsonSlurper\nimport com.santaba.agent.groovyapi.http.HTTP\n\n// Set check poll interval\ndef checkPollInterval_ms = taskProps.get(\"pollInterval\")?.toInteger() ?: 2 * 60\ncheckPollInterval_ms = checkPollInterval_ms * 1000\nInteger keyExpiry = checkPollInterval_ms * 4\nLong now = (new Date()).getTime()\n\n// Load collector cache\nScriptCache collectorCache = this.class.classLoader.loadClass(\"com.santaba.agent.util.script.ScriptCache\").getCache()\n\n// Gather cluster information\nMap k8s_info = getKubernetesProperties( hostProps, instanceProps )\nString useSSL = k8s_info.get(\"k8s_service_ssl\", true)\n\ncollectorCache.set(makeKey(\"watchdog\", \"lastCheckIn\"), now.toString(), keyExpiry)\ncollectorCache.set(makeKey(\"watchdog\", \"pollInterval\"), checkPollInterval_ms.toString(), keyExpiry)\n\nString lastUpdate = collectorCache.get(makeKey(\"fetchTask\", \"lastCheckIn\"))\n\nprintln \"checkPollInterval_ms=${checkPollInterval_ms}\"\nif (lastUpdate) {\n /* Report task metrics here */\n println \"isAlive=1\"\n println \"lastUpdate=${(now - lastUpdate.toBigInteger()) / 1000}\"\n String payload = collectorCache.get(makeKey(\"data\", \"payload\"))\n String collectDuration = collectorCache.get(makeKey(\"data\", \"collectDuration\"))\n\n println \"collectDuration=${collectDuration}\"\n\n if (payload != null) {\n println \"dataSize=${payload.size()}\"\n }\n} else {\n /* Process is dead, would start a new one */\n println \"isAlive=0\"\n println \"k8s_info=${k8s_info.size()}\"\n Thread.start {\n fetchTask(collectorCache, checkPollInterval_ms, k8s_info)\n }\n}\n\nreturn 0\n\n/* Actually collect data and stuff it into the cache. */\nstatic String collectData(ScriptCache collectorCache, Integer checkPollInterval_ms, Map k8s_info) {\n\n String rawMetrics = {}\n try {\n rawMetrics = httpGet(k8s_info.ksm_url, k8s_info)\n collectorCache.set(makeKey(\"data\", \"payload\"),\n rawMetrics, checkPollInterval_ms * 2)\n println \"metricsFetch=1\"\n } catch(Exception e) {\n println \"metricsFetch=0\"\n }\n \n return rawMetrics\n}\n\n/* Actual task that gets invoked when a new thread is started. */\nstatic void fetchTask(ScriptCache collectorCache, Integer checkPollInterval_ms, Map k8s_info) {\n\n String pollInterval_k = makeKey(\"watchdog\", \"pollInterval\")\n String restartCheck_k = makeKey(\"watchdog\", \"restartRequested\")\n String wdLastCheckIn_k = makeKey(\"watchdog\", \"lastCheckIn\")\n String threadId_k = makeKey(\"watchdog\", \"threadId\")\n String ftLastCheckIn_k = makeKey(\"fetchTask\", \"lastCheckIn\")\n String collectDuration_k = makeKey(\"data\", \"collectDuration\")\n\n String threadId = Thread.currentThread().getId().toString()\n\n // Log context used for subsequent calls.\n def logContext = \"taskType=KubernetesKSMFeeder tId=${threadId}\"\n\n if (collectorCache.get(threadId_k) == null) {\n collectorCache.set(threadId_k, threadId, checkPollInterval_ms * 2)\n } else {\n LogMsg.error(\"Refusing to start with another thread running\", logContext)\n return\n }\n\n while (!Thread.currentThread().isInterrupted()) {\n // Is the watchdog still watching.\n if (collectorCache.get(wdLastCheckIn_k) == null) {\n LogMsg.info(\"Watch dog failed to check-in, exiting main loop\", logContext)\n break\n }\n\n // Check if the a restart has been requested.\n if (collectorCache.get(restartCheck_k) != null) {\n LogMsg.info(\"Restart requested, exiting main loop\", logContext)\n break\n }\n\n // Update the check interval if it's changed.\n String newPollInterval = collectorCache.get(pollInterval_k)\n if (newPollInterval != checkPollInterval_ms.toString()) {\n try {\n checkPollInterval_ms = newPollInterval.toInteger()\n }\n catch (NumberFormatException ignored) {\n }\n }\n\n // Run the collection task\n Long collectionStartTs_ms = (new Date()).getTime()\n // Explicitly hold a reference to the cached payload.\n collectData(collectorCache, checkPollInterval_ms, k8s_info)\n\n \n Long collectionEndTs_ms = (new Date()).getTime()\n\n // Check in with the collector\n collectorCache.set(ftLastCheckIn_k, (new Date()).getTime().toString(), checkPollInterval_ms * 2)\n\n collectorCache.set(collectDuration_k, (collectionEndTs_ms - collectionStartTs_ms).toString(), checkPollInterval_ms * 2)\n\n // Log some stats about the collection process.\n LogMsg.debug(\"Took ${collectionEndTs_ms - collectionStartTs_ms} ms to run collection task\", logContext)\n\n // Crazy ivan that we are indeed the only running thread.\n String registeredThreadId = collectorCache.get(threadId_k)\n if (registeredThreadId != null) {\n if (registeredThreadId != threadId) {\n LogMsg.error(\"There seems to be multiple threads refreshing the cache, exiting this one\", logContext)\n break\n }\n }\n\n collectorCache.set(threadId_k, threadId, checkPollInterval_ms * 2)\n\n // Wait until the next cycle\n boolean inOverRun = waitUntil(collectionStartTs_ms, checkPollInterval_ms)\n if (inOverRun) LogMsg.info(\"Over-run detected, task is taking longer than the poll interval\", logContext)\n\n }\n\n // Cleanup\n collectorCache.set(threadId_k, null, 0)\n collectorCache.set(restartCheck_k, null, 0)\n collectorCache.set(ftLastCheckIn_k, null, 0)\n}\n\n/**\n * Wait until_ms has passed starting from from_ts. Returns true if we are in over-run mode (until_ts has passed).\n * @param from_ms timestamp from which to wait.\n * @param until_ms\n * @return true if schedule has been over-run.\n */\nstatic boolean waitUntil(Long from_ms, Integer until_ms) {\n Long now = (new Date()).getTime()\n Long deadLine = from_ms + until_ms\n\n if (deadLine > now) {\n Long sleepTime = deadLine - now\n Thread.sleep(sleepTime)\n return false\n }\n\n return true\n}\n\n// KSM specific http get function.\nstatic String httpGet(String endpoint, Map k8s_info) {\n def headers = [\n \"Authorization\": \"Bearer ${k8s_info.k8s_serviceaccount_token}\"\n ]\n\n def request = endpoint.toURL().openConnection()\n\n headers.each { request.addRequestProperty(it.key, it.value) }\n def responseCode = request.getResponseCode()\n\n if (responseCode == 200) {\n return request.content.text\n } else {\n throw new Exception(\"Unexpected http response code ${responseCode} from GET to ${endpoint}\")\n }\n}\n\n// Shorthand used for uniform key generation\nstatic String makeKey(String facility, String attributeName) {\n return \"KubernetesKSM:${facility}.${attributeName}\"\n}\n\ndef getKubernetesProperties( parent_hostProps, parent_instanceProps )\n{\n def k8s_namespace = parent_hostProps?.get(\"auto.namespace\")\n def k8s_name = parent_hostProps?.get(\"auto.name\")\n def k8s_nodename = parent_hostProps?.get(\"auto.nodename\")\n def k8s_selflink = parent_hostProps?.get(\"auto.selflink\")\n def k8s_ssl = parent_hostProps?.get(\"auto.kubernetes.label.ssl\") ? parent_hostProps?.get(\"auto.kubernetes.label.ssl\") : true\n\n def env = System.getenv()\n def k8s_service_host = env[\"KUBERNETES_SERVICE_HOST\"]\n def k8s_service_port = env.get(\"KUBERNETES_SERVICE_PORT\")?.toInteger()?:443\n\n def k8s_service_ssl = (k8s_service_port == 443)\n if ( k8s_ssl ) { k8s_service_ssl = k8s_ssl }\n\n def k8s_serviceaccount_token = new File('/var/run/secrets/kubernetes.io/serviceaccount/token').text\n def request_headers = [\"Authorization\" : \"Bearer ${k8s_serviceaccount_token}\"];\n\n def ksm_url = parent_hostProps?.get(\"auto.ksm.service.url\")\n\n return [\n k8s_namespace: k8s_namespace,\n k8s_name: k8s_name,\n k8s_serviceaccount_token: k8s_serviceaccount_token,\n k8s_selflink: k8s_selflink,\n k8s_service_host: k8s_service_host,\n k8s_service_port: k8s_service_port,\n k8s_service_ssl: k8s_service_ssl,\n k8s_nodename: k8s_nodename,\n ksm_url: ksm_url\n ]\n}"}, "datapoints": [{"name": "collectDuration", "description": "Total time required for collection of metrics data from kuber-state-metrics in ms.", "interpretMethod": "namevalue", "interpretExpr": "collectDuration", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "dataSize", "description": "Size of metrics data collected from kube-state-metrics.", "interpretMethod": "namevalue", "interpretExpr": "dataSize", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "isAlive", "description": "Indicator for whether the Kubernetes WatchDog is running & able to collect metrics from kube-state-metrics.\n\nStatus codes:\n1 = Alive,\n0 = Not Alive", "interpretMethod": "namevalue", "interpretExpr": "isAlive", "useValue": "output", "type": "gauge", "dataType": 7, "min": "0", "max": "1", "threshold": "= 0", "noData": "Do not trigger an alert", "triggerInterval": 5, "clearInterval": 0, "alertSubject": "Watchdog not alive", "alertBody": "Kubernetes Watchdog is not able to collect metrics & is not in an alive state (alive == ##VALUE##). Hence ##HOST## raised a ##LEVEL## alert. \n\nThis started at ##START## -- or ##DURATION## ago."}, {"name": "lastUpdate", "description": "Time in seconds when last update was performed by Kubernetes Watchdog.", "interpretMethod": "namevalue", "interpretExpr": "lastUpdate", "useValue": "output", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Collection Duration", "title": "Collection Duration", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "collectDuration", "datapointName": "collectDuration", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "collectDuration", "color": "blue", "datapointName": "collectDuration", "isVirtual": false}]}, {"name": "Data Size", "title": "Data Size", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "dataSize", "datapointName": "dataSize", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "dataSize", "color": "blue", "datapointName": "dataSize", "isVirtual": false}]}, {"name": "Seconds Since Last Update", "title": "Seconds Since Last Update", "verticalLabel": "seconds", "min": 0.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "lastUpdate", "datapointName": "lastUpdate", "consolidationFn": "max"}], "lines": [{"type": "line", "legend": "lastUpdate", "color": "blue", "datapointName": "lastUpdate", "isVirtual": false}]}, {"name": "Watchdog Alive", "title": "Watchdog Alive", "verticalLabel": "0=no, 1=yes", "min": -1.0, "max": 2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "isAlive", "datapointName": "isAlive", "consolidationFn": "min"}], "lines": [{"type": "area", "legend": "isAlive", "color": "blue", "datapointName": "isAlive", "isVirtual": false}]}]}

×DataSource: SaaS_Zoom_SubAccountUtilization (2481814)

{"name": "SaaS_Zoom_SubAccountUtilization", "description": "Monitor sub-account utilization of licensing and storage resources.", "appliesTo": "hasCategory(\"SAAS/Zoom\")", "searchKeywords": "saas,subaccount,zoom,utilization", "technicalNotes": "Support Documentation: https://www.logicmonitor.com/support/monitoring/applications-databases/zoom-monitoring", "displayedAs": "SaaS Zoom Sub Account Utilization", "collectionInterval": "3m", "collectionMethod": "saaszoomplanusage", "multiInstance": true, "dataSourceType": 1, "activeDiscovery": {"enabled": true, "discoveryMethod": "ad_saaszoomplanusage", "discoveryInterval": "0m", "deleteInactiveInstances": false, "disableDiscoveredInstances": false, "autoDeleteInstances": false, "params": {"zoomPlanUsageType": "subaccount"}, "groupMethod": "none"}, "collectionAttrs": {"planType": "subaccount"}, "datapoints": [{"name": "BaseHosts", "description": "The number of hosts in the zoom base plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_base.hosts\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BaseLicensingUsePercent", "description": "Percentage of zoom base licenses used", "interpretMethod": "expression", "interpretExpr": "(BaseUsage/BaseHosts)*100", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "BaseUsage", "description": "Number of total usage of zoom base plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_base.usage\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "LargeMeetingHosts", "description": "The number of hosts in the zoom large meeting plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_large_meeting.hosts\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "LargeMeetingLicensingUse", "description": "Percentage of zoom large meeting licenses used", "interpretMethod": "expression", "interpretExpr": "(LargeMeetingUsage/LargeMeetingHosts)*100", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "LargeMeetingUsage", "description": "Number of total usage of zoom large meeting plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_large_meeting.usage\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PlanStorage", "description": "Storage used by this account", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_recording.plan_storage\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PlanStorageExceed", "description": "Excess storage used by this account", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_recording.plan_storage_exceed\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "PlanStorageUsage", "description": "Storage allocated for this account", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_recording.plan_storage_usage\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RoomConnectorHosts", "description": "The number of hosts in the zoom account's H.323/SIP Device Room Connector plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_room_connector.hosts\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RoomConnectorUsage", "description": "Number of total usage of zoom account's H.323/SIP Device Room Connector plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_room_connector.usage\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "RoomsLicensingUsePercent", "description": "Percentage of zoom rooms licenses used", "interpretMethod": "expression", "interpretExpr": "(ZoomRoomsUsage/ZoomRoomsHosts)*100", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "StorageUsePercent", "description": "Percentage of Storage used", "interpretMethod": "expression", "interpretExpr": "(PlanStorageUsage/PlanStorage)*100", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UnitedHosts", "description": "The number of hosts in the zoom united plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_united.hosts\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "UnitedUsage", "description": "Number of total usage of zoom united plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_united.usage\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WebinarHosts", "description": "The number of hosts in the zoom webinar plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_webinar.hosts\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WebinarLicensingUsePercent", "description": "Percentage of zoom webinar licenses used", "interpretMethod": "expression", "interpretExpr": "(WebinarUsage/WebinarHosts)*100", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "WebinarUsage", "description": "Number of total usage of zoom webinar plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_webinar.usage\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ZoomEventsHosts", "description": "The number of hosts in the zoom events plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_zoom_events.hosts\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ZoomEventsUsage", "description": "Number of total usage of zoom events plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_zoom_events.usage\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ZoomRoomsHosts", "description": "The number of hosts in the zoom rooms plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_zoom_rooms.hosts\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "ZoomRoomsUsage", "description": "Number of total usage of zoom rooms plan", "interpretMethod": "none", "interpretExpr": "{\"jsonPath\":\"plan_zoom_rooms.usage\"}", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Base License Utilization", "title": "Base License Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 2, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BaseLicensingUsePercent", "datapointName": "BaseLicensingUsePercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Base License Utilization", "color": "orange2", "datapointName": "BaseLicensingUsePercent", "isVirtual": false}]}, {"name": "BaseLicensing", "title": "BaseLicensing", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "BaseHosts", "datapointName": "BaseHosts", "consolidationFn": "average"}, {"name": "BaseUsage", "datapointName": "BaseUsage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "BaseHosts", "color": "olive", "datapointName": "BaseHosts", "isVirtual": false}, {"type": "line", "legend": "BaseUsage", "color": "silver", "datapointName": "BaseUsage", "isVirtual": false}]}, {"name": "EventsLicensing", "title": "EventsLicensing", "verticalLabel": "count", "min": 0.0, "displayPriority": 13, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ZoomEventsHosts", "datapointName": "ZoomEventsHosts", "consolidationFn": "average"}, {"name": "ZoomEventsUsage", "datapointName": "ZoomEventsUsage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "ZoomEventsHosts", "color": "black", "datapointName": "ZoomEventsHosts", "isVirtual": false}, {"type": "line", "legend": "ZoomEventsUsage", "color": "lime", "datapointName": "ZoomEventsUsage", "isVirtual": false}]}, {"name": "Large Meeting License Utilization", "title": "Large Meeting License Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 6, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "LargeMeetingLicensingUse", "datapointName": "LargeMeetingLicensingUse", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Large Meeting License Utilization", "color": "yellow", "datapointName": "LargeMeetingLicensingUse", "isVirtual": false}]}, {"name": "LargeMeetingLicensing", "title": "LargeMeetingLicensing", "verticalLabel": "count", "min": 0.0, "displayPriority": 5, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "LargeMeetingHosts", "datapointName": "LargeMeetingHosts", "consolidationFn": "average"}, {"name": "LargeMeetingUsage", "datapointName": "LargeMeetingUsage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "LargeMeetingHosts", "color": "green", "datapointName": "LargeMeetingHosts", "isVirtual": false}, {"type": "line", "legend": "LargeMeetingUsage", "color": "blue", "datapointName": "LargeMeetingUsage", "isVirtual": false}]}, {"name": "RoomConnectorLicensing", "title": "RoomConnectorLicensing", "verticalLabel": "count", "min": 0.0, "displayPriority": 12, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "RoomConnectorHosts", "datapointName": "RoomConnectorHosts", "consolidationFn": "average"}, {"name": "RoomConnectorUsage", "datapointName": "RoomConnectorUsage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "RoomConnectorHosts", "color": "orange", "datapointName": "RoomConnectorHosts", "isVirtual": false}, {"type": "line", "legend": "RoomConnectorUsage", "color": "aqua", "datapointName": "RoomConnectorUsage", "isVirtual": false}]}, {"name": "RoomLicensing", "title": "RoomLicensing", "verticalLabel": "count", "min": 0.0, "displayPriority": 3, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ZoomRoomsHosts", "datapointName": "ZoomRoomsHosts", "consolidationFn": "average"}, {"name": "ZoomRoomsUsage", "datapointName": "ZoomRoomsUsage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "ZoomRoomsHosts", "color": "fuchsia", "datapointName": "ZoomRoomsHosts", "isVirtual": false}, {"type": "line", "legend": "ZoomRoomsUsage", "color": "gray", "datapointName": "ZoomRoomsUsage", "isVirtual": false}]}, {"name": "Rooms License Utilization", "title": "Rooms License Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 4, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "RoomsLicensingUsePercent", "datapointName": "RoomsLicensingUsePercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Rooms License Utilization", "color": "red1", "datapointName": "RoomsLicensingUsePercent", "isVirtual": false}]}, {"name": "Storage", "title": "Storage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 9, "timeScale": "1day", "scale1024": true, "rigid": false, "datapoints": [{"name": "PlanStorage", "datapointName": "PlanStorage", "consolidationFn": "average"}, {"name": "PlanStorageExceed", "datapointName": "PlanStorageExceed", "consolidationFn": "average"}, {"name": "PlanStorageUsage", "datapointName": "PlanStorageUsage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "Allocated", "color": "silver", "datapointName": "PlanStorage", "isVirtual": false}, {"type": "line", "legend": "Excess", "color": "red2", "datapointName": "PlanStorageExceed", "isVirtual": false}, {"type": "line", "legend": "In Use", "color": "green", "datapointName": "PlanStorageUsage", "isVirtual": false}]}, {"name": "Storage Utilization", "title": "Storage Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 10, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "StorageUsePercent", "datapointName": "StorageUsePercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Storage Utilization", "color": "navy", "datapointName": "StorageUsePercent", "isVirtual": false}]}, {"name": "UnitedLicensing", "title": "UnitedLicensing", "verticalLabel": "count", "min": 0.0, "displayPriority": 11, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "UnitedHosts", "datapointName": "UnitedHosts", "consolidationFn": "average"}, {"name": "UnitedUsage", "datapointName": "UnitedUsage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "UnitedHosts", "color": "red2", "datapointName": "UnitedHosts", "isVirtual": false}, {"type": "line", "legend": "UnitedUsage", "color": "green", "datapointName": "UnitedUsage", "isVirtual": false}]}, {"name": "Webinar License Utilization", "title": "Webinar License Utilization", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 8, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "WebinarLicensingUsePercent", "datapointName": "WebinarLicensingUsePercent", "consolidationFn": "average"}], "lines": [{"type": "area", "legend": "Webinar License Utilization", "color": "maroon", "datapointName": "WebinarLicensingUsePercent", "isVirtual": false}]}, {"name": "WebinarLicensing", "title": "WebinarLicensing", "verticalLabel": "count", "min": 0.0, "displayPriority": 7, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "WebinarHosts", "datapointName": "WebinarHosts", "consolidationFn": "average"}, {"name": "WebinarUsage", "datapointName": "WebinarUsage", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "WebinarHosts", "color": "olive", "datapointName": "WebinarHosts", "isVirtual": false}, {"type": "line", "legend": "WebinarUsage", "color": "teal", "datapointName": "WebinarUsage", "isVirtual": false}]}], "overviewGraphs": [{"name": "Top 10 SubAccounts by Base Plan Hosts", "title": "Top 10 SubAccounts by Base Plan Hosts", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "BaseHosts", "datapointName": "BaseHosts", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "BaseHosts", "isVirtual": false}]}, {"name": "Top 10 SubAccounts by Large Meeting Plan Hosts", "title": "Top 10 SubAccounts by Large Meeting Plan Hosts", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "LargeMeetingHosts", "datapointName": "LargeMeetingHosts", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "LargeMeetingHosts", "isVirtual": false}]}, {"name": "Top 10 SubAccounts by Percent Base Plan License Usage", "title": "Top 10 SubAccounts by Percent Base Plan License Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "BaseLicensingUsePercent", "datapointName": "BaseLicensingUsePercent", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "BaseLicensingUsePercent", "isVirtual": false}]}, {"name": "Top 10 SubAccounts by Percent Large Meeting Plan License Usage", "title": "Top 10 SubAccounts by Percent Large Meeting Plan License Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "LargeMeetingLicensingUse", "datapointName": "LargeMeetingLicensingUse", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "LargeMeetingLicensingUse", "isVirtual": false}]}, {"name": "Top 10 SubAccounts by Percent Rooms Plan License Usage", "title": "Top 10 SubAccounts by Percent Rooms Plan License Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "RoomsLicensingUsePercent", "datapointName": "RoomsLicensingUsePercent", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "RoomsLicensingUsePercent", "isVirtual": false}]}, {"name": "Top 10 SubAccounts by Percent Storage Usage", "title": "Top 10 SubAccounts by Percent Storage Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "StorageUsePercent", "datapointName": "StorageUsePercent", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "StorageUsePercent", "isVirtual": false}]}, {"name": "Top 10 SubAccounts by Percent Webinar Plan License Usage", "title": "Top 10 SubAccounts by Percent Webinar Plan License Usage", "verticalLabel": "%", "min": 0.0, "max": 100.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "WebinarLicensingUsePercent", "datapointName": "WebinarLicensingUsePercent", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "WebinarLicensingUsePercent", "isVirtual": false}]}, {"name": "Top 10 SubAccounts by Rooms Plan Hosts", "title": "Top 10 SubAccounts by Rooms Plan Hosts", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "ZoomRoomsHosts", "datapointName": "ZoomRoomsHosts", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "ZoomRoomsHosts", "isVirtual": false}]}, {"name": "Top 10 SubAccounts by Storage Usage", "title": "Top 10 SubAccounts by Storage Usage", "verticalLabel": "bytes", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": true, "rigid": false, "datapoints": [{"name": "PlanStorageUsage", "datapointName": "PlanStorageUsage", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "PlanStorageUsage", "isVirtual": false}]}, {"name": "Top 10 SubAccounts by Webinar Plan Hosts", "title": "Top 10 SubAccounts by Webinar Plan Hosts", "verticalLabel": "count", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "aggregated": false, "scale1024": false, "rigid": false, "datapoints": [{"name": "WebinarHosts", "datapointName": "WebinarHosts", "consolidationFn": "average", "aggregateMethod": "sum"}], "lines": [{"type": "line", "legend": "##INSTANCE##", "color": "silver", "datapointName": "WebinarHosts", "isVirtual": false}]}]}

×DataSource: Kubernetes_KSM_PodDisruptionBudget (2481817)

{"name": "Kubernetes_KSM_PodDisruptionBudget", "description": "Monitors Kubernetes PodDisruptionBudget via KSM", "appliesTo": "hasCategory(\"KubernetesPodDisruptionBudget\") && hasCategory(\"KubernetesKSM\")", "searchKeywords": "poddisruptionbudget,ksm,pdb", "displayedAs": "Kubernetes Pod Disruption Budget", "collectionInterval": "1m", "collectionMethod": "openmetrics", "multiInstance": false, "dataSourceType": 1, "collectionAttrs": {"url": "##auto.ksm.service.url##", "connectTimeoutMs": 2000, "readTimeoutMs": 10000, "followRedirect": false}, "datapoints": [{"name": "currentHealthyPods", "description": "Current number of healthy pods", "config": {"metricName": "kube_poddisruptionbudget_status_current_healthy", "instanceLabel": "namespace=\"##auto.namespace##\",poddisruptionbudget=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",poddisruptionbudget=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "desiredHealthyPods", "description": "Minimum desired number of healthy pods", "config": {"metricName": "kube_poddisruptionbudget_status_desired_healthy", "instanceLabel": "namespace=\"##auto.namespace##\",poddisruptionbudget=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",poddisruptionbudget=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "disruptionsAllowed", "description": "Number of pod disruptions that are currently allowed", "config": {"metricName": "kube_poddisruptionbudget_status_pod_disruptions_allowed", "instanceLabel": "namespace=\"##auto.namespace##\",poddisruptionbudget=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",poddisruptionbudget=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "expectedPods", "description": "Total number of pods counted by this disruption budget", "config": {"metricName": "kube_poddisruptionbudget_status_expected_pods", "instanceLabel": "namespace=\"##auto.namespace##\",poddisruptionbudget=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",poddisruptionbudget=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}, {"name": "invalidCurrentHealthy", "description": "Difference of desired pods and current healthy pods", "config": {}, "interpretMethod": "expression", "interpretExpr": "desiredHealthyPods - currentHealthyPods", "type": "gauge", "dataType": 7, "min": "-1000", "threshold": "> 0 0", "noData": "Trigger error alert", "triggerInterval": 5, "clearInterval": 5, "alertBody": "The podDisruptionBudget ##auto.name## on ##HOST## is reporting that it has ##VALUE## current healthy pods, placing the host in a ##LEVEL## state.\n\nThis started at ##START## - or ##DURATION## ago."}, {"name": "observedGeneration", "description": "Most recent generation observed when updating this PDB status", "config": {"metricName": "kube_poddisruptionbudget_status_observed_generation", "instanceLabel": "namespace=\"##auto.namespace##\",poddisruptionbudget=\"##auto.name##\"", "aggregateMethod": "none"}, "interpretMethod": "regex", "interpretExpr": "namespace=\"##auto.namespace##\",poddisruptionbudget=\"##auto.name##\"", "useValue": "body", "type": "gauge", "dataType": 7, "noData": "Do not trigger an alert", "triggerInterval": 0, "clearInterval": 0}], "graphs": [{"name": "Generations", "title": "Generations", "verticalLabel": "value", "min": -2.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "ObservedGeneration", "datapointName": "observedGeneration", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "kubePoddisruptionbudgetStatusObservedGeneration", "color": "silver", "datapointName": "ObservedGeneration", "isVirtual": false}]}, {"name": "PDBStatus", "title": "PDBStatus", "verticalLabel": "value", "min": 0.0, "displayPriority": 1, "timeScale": "1day", "scale1024": false, "rigid": false, "datapoints": [{"name": "CurrentHealthy", "datapointName": "currentHealthyPods", "consolidationFn": "average"}, {"name": "DesiredHealthy", "datapointName": "desiredHealthyPods", "consolidationFn": "average"}, {"name": "ExpectedPods", "datapointName": "expectedPods", "consolidationFn": "average"}, {"name": "PodDisruptionsAllowed", "datapointName": "disruptionsAllowed", "consolidationFn": "average"}], "lines": [{"type": "line", "legend": "CurrentHealthy", "color": "green", "datapointName": "CurrentHealthy", "isVirtual": false}, {"type": "line", "legend": "DesiredHealthy", "color": "orange2", "datapointName": "DesiredHealthy", "isVirtual": false}, {"type": "line", "legend": "ExpectedPods", "color": "purple", "datapointName": "ExpectedPods", "isVirtual": false}, {"type": "line", "legend": "PodDisruptionsAllowed", "color": "silver", "datapointName": "PodDisruptionsAllowed", "isVirtual": false}]}]}